摘要: 尽量不要在MFC线程中将CWnd作为参数传递,会引起crash正确的做法:1. 将CWnd对应的handle传进来,通过CWnd::FromHandle()函数转换;2. 在线程中用SendMessage/PostMessage的方式进行通信。 阅读全文
posted @ 2013-09-14 00:32 ximenchuixie 阅读(217) 评论(0) 推荐(0) 编辑
摘要: cmd窗口中 for /? 查询参数含义%~dp0, 将参数转换为磁盘路径+名字例:脚本中一行%~dp0abc.exe (abc.exe位置c:\test\abc.exe)展开后则为 c:\test\abc.exe 阅读全文
posted @ 2013-09-12 03:42 ximenchuixie 阅读(155) 评论(0) 推荐(0) 编辑
摘要: http chunked传输:将信息分段传输好处:不用指定content-length字段(总的要传输文件信息的长度),即可以将一整段信息分为若干段分别发送,最后发送chunked长度为0的信息表示整段信息发送结束,可实现动态发送消息。http://en.wikipedia.org/wiki/Chunked_transfer_encoding 阅读全文
posted @ 2013-09-11 00:12 ximenchuixie 阅读(228) 评论(0) 推荐(0) 编辑
摘要: int a[20];int len = sizeof(a)/sizeof(*a); //值为20,即数组长度为20注:sizeof是一个操作符,sizeof的值在编译时确定 阅读全文
posted @ 2013-09-10 01:09 ximenchuixie 阅读(496) 评论(0) 推荐(0) 编辑
摘要: 现代c++尽量使用vector(容器)和迭代器(相当于指针),少使用数组和指针,除非对程序执行效率有很高的要求。容器优点,易于扩展,可通过push_back方法动态添加元素,数组不能动态添加元素。用法:例:vector a;for(vertor::iterator ita = a.begin(); ita != a.end(); ita++){ *ita = 0;} 阅读全文
posted @ 2013-09-09 01:27 ximenchuixie 阅读(596) 评论(0) 推荐(0) 编辑
摘要: const对象:const对象声明时必须赋初值,该值在编译阶段确定,不可在程序中修改。const修饰符既可放在类型名前也可放在类型名后,通常放在类型名前。不过放在类型名后易于理解。const int a = 7;int b = 8;int array[a];//合法, a是const变量,值在编译阶段确认int arr[b]; //不合法,b是个普通变量,值没有在编译阶段确定指向const对象的指针:可理解为“自认为指向const对象的指针”,其实际所指向的对象不一定是const对象不能通过指向const对象的指针修改其指向的对象的值,即使该对象为非const对象。指针本身可以赋其他值,由于指 阅读全文
posted @ 2013-09-07 17:31 ximenchuixie 阅读(303) 评论(0) 推荐(0) 编辑
摘要: IsNetworkAliveBool IsNetworkAlive( _Out_LPDWORD lpdwFlags);HeaderSensapi.hLibrarySensapi.libhttp://msdn.microsoft.com/en-us/library/windows/desktop/aa377522(v=vs.85).aspx 阅读全文
posted @ 2013-08-21 17:17 ximenchuixie 阅读(415) 评论(0) 推荐(0) 编辑
摘要: MSDN:bManualReset[in]If this parameter isTRUE, the function creates a manual-reset event object, which requires the use of theResetEventfunction to set the event state to nonsignaled. If this parameter isFALSE, the function creates an auto-reset event object, and system automatically resets the even 阅读全文
posted @ 2013-08-15 13:55 ximenchuixie 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 1)数组名指代的实体是一种数据结构,这种数据结构就是数组。如int a[10]相当于int[10] a, a是int[10]数据结构。因此sizeof(a)的值为40(4*10)。而如果声明 int* a的话sizeof(a)的值为4(指针占内存的大小)。2)数组名可以转换成指针。3)作为函数形参的数组名就是指针。 阅读全文
posted @ 2013-08-05 21:58 ximenchuixie 阅读(159) 评论(0) 推荐(0) 编辑
摘要: $(SolutionDir) solution目录$(ProjectDir) Project目录$(TargetDir) 目标文件夹,如编译出的exe文件所在的目录$(Configuration) Release或Debug 阅读全文
posted @ 2013-07-27 13:08 ximenchuixie 阅读(118) 评论(0) 推荐(0) 编辑