摘要: 示例文件://保存为message.c文件#include INT CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPreInstance, LPSTR lpCmdLine, int nCmdShow){ MessageBox(NULL, TEXT("Hello, World"), TEXT("test"), MB_OK); return 0;}方法一:编译和链接分开进行:① 打开Visual Studio命令行提示工具② cd到保存message.c的path下③ 编译源文件 cl /c /EHsc m 阅读全文
posted @ 2013-10-13 20:14 a ray of sunshine 阅读(235) 评论(0) 推荐(0) 编辑
摘要: 字符串可以分配在栈,堆,和字符串常量区(静态数据区)中,这三种不同的内存结构具有不同的页(page)属性,这些属性决定了三种不同的字符串特性:1.在栈上分配字符串 在栈上分配字符串实质上又可以分成两种方法,具体方法如下所示: ① TCHAR str1[5] = {'H', 'e', 'l', 'l', 'o'};如图上图所示,它是语句①汇编后的代码,图中的红色方框一中的代码表示在栈上分配16个字节,红色方框二中的代码,将字符'H', 'e', 'l', 'l& 阅读全文
posted @ 2013-10-13 20:05 a ray of sunshine 阅读(723) 评论(0) 推荐(0) 编辑
摘要: (1) 用MIDL编写.idl文件//将以下代码保存成 IXIYIZ.idl 文件//在命令行上进行编译,编译命令://midl IXIYIZ.idl//生成 IXIYIZ.h ,dlldata.c, IXIYIZ.h, IXIYIZ_p.c//其中 IXIYIZ.h,IXIYIZ.h 文件是我们目前所需要的import "unknwn.idl";[ object, uuid(7F67119B-1E09-4d4f-B472-2106CCAE3275)]interface IX: IUnknown{ [local] void __stdcall Fx();};[ o... 阅读全文
posted @ 2013-10-13 19:47 a ray of sunshine 阅读(641) 评论(0) 推荐(0) 编辑
摘要: 1. Alertable I/O 的概念Alertable I/O 是异步I/O操作完成之后,对其结果进行处理的一种机制,为了理解Alertable I/O,读下面的文章(来自MSDN)Alertable I/O is the method by which application threads process asynchronous I/O requests only when they are in an alertable state.To understand when a thread is in an alertable state, consider the followin 阅读全文
posted @ 2013-10-13 19:28 a ray of sunshine 阅读(426) 评论(0) 推荐(0) 编辑