Roger Luo

超越梦想一起飞
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

随笔分类 -  Windows

摘要:#pragma intrinsic (_InterlockedIncrement)#pragma intrinsic (_InterlockedDecrement)#pragma intrinsic (memcpy)The intrinsic pragma tells the compiler that a function has known behavior. The compiler may... 阅读全文

posted @ 2013-05-06 18:14 Roger Luo 阅读(363) 评论(0) 推荐(0)

摘要:内存映射文件 内存映射文件与虚拟内存有些类似,通过内存映射文件可以保留一个地址空间的区域,同时将物理存储器提交给此区域,只是内存文件映射的物理存储器来自一个已经存在于磁盘上的文件,而非系统的页文件,而且在对该文件进行操作之前必须首先对文件进行映射,就如同将整个文件从磁盘加载到内存。由此可以看出,使用内存映射文件处理存储于磁盘上的文件时,将不必再对文件执行I/O操作,这意味着在对文件进行处理时将不... 阅读全文

posted @ 2013-03-05 16:27 Roger Luo 阅读(2718) 评论(0) 推荐(0)

摘要:IO notification has 6 models 1. synchronous completion for “fast” I/O 2. polling 3. signaling the device kernel object directly 4. signaling an event object provided when I/O started 5. pos... 阅读全文

posted @ 2013-03-05 15:25 Roger Luo 阅读(319) 评论(0) 推荐(0)

摘要:MSSQL 2008 Using entity framework 1. Preparation Install SQL Server 2005 or Higher, link Install SQL Server 2000 Sample Databases, link Install .NET Framework 3.0 or Higher 2. Check whether Insta... 阅读全文

posted @ 2013-03-05 15:13 Roger Luo 阅读(945) 评论(0) 推荐(0)

摘要:Create file HANDLE hFile = ::CreateFile(lpcszFileName, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, CREATE_ALWAY... 阅读全文

posted @ 2013-03-05 11:27 Roger Luo 阅读(289) 评论(0) 推荐(0)

摘要:Synchronously loading image PictureBox pbx = new PictureBox();pbx.Image = Image.FromFile(filename);or PictureBox pbx = new PictureBox();pbx.Load(filename); // filename could be the url file:/... 阅读全文

posted @ 2013-03-02 18:36 Roger Luo 阅读(7238) 评论(0) 推荐(0)

摘要:1. Preparation Download the installation package(.iso) on msdn website. 2. Installation Guide Load iso file by virutal tool, recommend to use the virtual cd-rom control panel tool whichi is publis... 阅读全文

posted @ 2013-03-02 16:44 Roger Luo 阅读(401) 评论(0) 推荐(0)

摘要:Assuming there are two panels in a winform, show like below. Panel1 Panel2 Panel1.dock is left. Panel2.dock is fill. Right now, add a status bar at the bottom of this wi... 阅读全文

posted @ 2013-03-02 09:57 Roger Luo 阅读(5523) 评论(1) 推荐(1)

摘要:Switching Windows Project and Console Project If you build up a win32 console project and want to convert to windwos application. You should change the subsystem property on link/subsystem from /co... 阅读全文

posted @ 2013-02-28 15:34 Roger Luo 阅读(616) 评论(0) 推荐(0)

摘要:Structure Introduction typedef struct hostent { char FAR *h_name; char FAR FAR **h_aliases; short h_addrtype; short h_length; char FAR FAR **h_addr_list;} HOSTENT, *P... 阅读全文

posted @ 2013-02-20 09:57 Roger Luo 阅读(331) 评论(0) 推荐(0)

摘要:typedef struct _OVERLAPPED { ULONG_PTR Internal; ULONG_PTR InternalHigh; union { struct { DWORD Offset; DWORD OffsetHigh; }; PVOID Pointer; }; HANDLE hEvent;} OVERLAP... 阅读全文

posted @ 2013-02-08 01:50 Roger Luo 阅读(161) 评论(0) 推荐(0)

摘要:Exception Handling Stack around the variable was corrupted 内存越界将会导致这个异常出现,例如如下代码: void Reset(void * pv){ if (pv) { double * pd = reinterpret_cast<double *>(pv); *pd = 0.0; ... 阅读全文

posted @ 2013-02-07 14:19 Roger Luo 阅读(209) 评论(0) 推荐(0)

摘要:Preparation Using visual studio to create dll binary as your project in order to reuse code conveniently. 1. Install visual studio which includes visual c++ 2. Create a new project (File/Create/Pro... 阅读全文

posted @ 2013-01-31 11:26 Roger Luo 阅读(221) 评论(0) 推荐(0)

摘要:Compiling On windows platform, goto the unpack folder, such as d:/libcurl/curl, find the winbuild diretory. Open the vs command line window and use “nmake makefile.vc” to compile the code, here is th... 阅读全文

posted @ 2013-01-30 23:35 Roger Luo 阅读(1207) 评论(0) 推荐(0)

摘要:如果是Windows 7,Shift+鼠标右键选择“Open command windows here”即可。 1) 进入注册表 HKEY_LOCAL_MACHINE/Software/Classes/Folder/Shell2) 在Shell下新建名为“Command Prompt”(显示在右键菜单中的文字)的Key。3) 在“Command Prompt”下新建名为“command”的Ke... 阅读全文

posted @ 2013-01-29 22:47 Roger Luo 阅读(238) 评论(0) 推荐(0)

摘要:Windows Socket 2 A socket handle can optionally be a file handle in Windows Sockets 2. A socket handle from a Winsock provider can be used with other non-Winsock functions such as ReadFile, Wri... 阅读全文

posted @ 2013-01-12 13:45 Roger Luo 阅读(1144) 评论(0) 推荐(0)

摘要:methods1. GetVersionDWORD WINAPI GetVersion(void);The following illustration shows the format of the bits in system version.+-------------+----------+-------------------------+| Reserved | Build Id | Minor | Major |+-------------+----------+-------------------------+31 30 29 16 15 8 7 ... 阅读全文

posted @ 2013-01-05 18:31 Roger Luo 阅读(347) 评论(0) 推荐(0)

摘要:NLS(National Language Support)Background(背景)Each language has a language name and a language identifierthat indicate the particular code page (ANSI, DOS, Macintosh) used to represent the geographical location for the language on the operating system.Data Type(数据类型)typedef WORD LANGID; typedef DWORD 阅读全文

posted @ 2013-01-05 17:07 Roger Luo 阅读(285) 评论(0) 推荐(0)

摘要:WinMain与mainWinMain的原型:int CALLBACK WinMain( __in HINSTANCE hInstance, __in HINSTANCE hPrevInstance, __in LPSTR lpCmdLine, __in int nCmdShow ); WinMain的定义:WinMain is the conventional name used for the application entry point for agraphical Windows-based application.#include <Windows.h> i... 阅读全文

posted @ 2013-01-03 14:20 Roger Luo 阅读(595) 评论(0) 推荐(0)

摘要:Task使用Task以及Task.Factory都是在.Net 4引用的。Task跟Thread很类似,通过下面例子可以看到。 static public void ThreadMain() { Thread t1 = new Thread(TaskWorker); t1.Start(3); } static public void TaskMain() { Task t1 = new Task(TaskWorker, 3, TaskCreat... 阅读全文

posted @ 2012-12-27 15:56 Roger Luo 阅读(18913) 评论(0) 推荐(2)