上一页 1 2 3 4 5 6 7 ··· 13 下一页
  2014年6月7日
摘要: void CMainWindow::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags ){ if((nChar=='A')&&(GetKeyState( VK_SHIFT)=_T('A'))&&(nChar=_T('a'))&&(nChar<=_T... 阅读全文
posted @ 2014-06-07 17:38 上海—Michael 阅读(582) 评论(0) 推荐(0) 编辑
  2014年6月6日
摘要: void CMainWindow::OnLButtonDown(UINT nFlags,CPoint point){ //以下三个是在CMainWindow中定义 m_ptFrom=point; m_ptTo=point; m_track=TRUE;}void CMainWi... 阅读全文
posted @ 2014-06-06 15:28 上海—Michael 阅读(687) 评论(0) 推荐(0) 编辑
  2014年6月4日
摘要: int cx=10;CString s;s.Format(_T("整数是:%d"),cx);MessageBox(s); 阅读全文
posted @ 2014-06-04 10:35 上海—Michael 阅读(758) 评论(0) 推荐(0) 编辑
  2014年5月30日
摘要: #include "stdafx.h"#include #include using namespace std;int _tmain (int argc, LPTSTR argv[]){ HANDLE h=CreateMutex(NULL,TRUE,"AAAAAAA"); if(Get... 阅读全文
posted @ 2014-05-30 14:30 上海—Michael 阅读(312) 评论(0) 推荐(0) 编辑
  2014年5月29日
摘要: 在我的博客之前写了很多关于IOCP的“行云流水”似的看了让人发狂的文章,尤其是几篇关于 IOCP加线程池文章,更是让一些功力不够深厚的初学IOCP者,有种吐血的感觉。为了让大家能够立刻提升内力修为,并且迅速的掌握IOCP这个 Windows平台上的乾坤大挪移心法,这次我决定给大家好好补补这个基础。要... 阅读全文
posted @ 2014-05-29 18:06 上海—Michael 阅读(1242) 评论(0) 推荐(0) 编辑
  2014年5月28日
摘要: 服务器: #include "stdafx.h"#include #pragma comment(lib, "ws2_32.lib")#include using namespace std;// 单句柄数据typedef struct tagPER_HANDLE_DATA{ SOCKET Sock... 阅读全文
posted @ 2014-05-28 18:12 上海—Michael 阅读(330) 评论(0) 推荐(0) 编辑
  2014年5月27日
摘要: 负值表示相对时间,正值表示绝对时间,定时器精度为100ns (1ns=1/10亿 s),所以 -50000000 代表5秒,详见MSDN。程序一为自动重置(先等待5秒,然后每1秒输出一次):#include "stdafx.h"#include#include#includeusing namesp... 阅读全文
posted @ 2014-05-27 16:03 上海—Michael 阅读(1122) 评论(0) 推荐(0) 编辑
  2014年5月23日
摘要: 文件传输的原理:发送方把文件读到socket发送端缓冲区中,接收方把socket接收端缓端冲区中的数据写到一个新文件中。当然了,大文件需要循环读写!服务器端为发送端:#include "stdafx.h"#include#include#pragma comment(lib,"ws2_32.lib"... 阅读全文
posted @ 2014-05-23 22:15 上海—Michael 阅读(677) 评论(0) 推荐(0) 编辑
摘要: #include "stdafx.h"#include #include #include #include #pragma comment(lib, "advapi32.lib")TCHAR szCommand[10];TCHAR szSvcName[80];SC_HANDLE schSCMana... 阅读全文
posted @ 2014-05-23 14:17 上海—Michael 阅读(577) 评论(0) 推荐(0) 编辑
  2014年5月22日
摘要: 本文将首先解释如何 创建 一个定期查询可用物理内存并将结果写入某个文本文件的服务。然后指导你完成生成,安装和实现服务的整个过程。第一步:主函数和全局定义首先,包含所需的头文件。例子要调用 Win32 函数(windows.h )和磁盘文件写入(stdio.h ):接着,定义两个常量:#define ... 阅读全文
posted @ 2014-05-22 23:07 上海—Michael 阅读(1665) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 13 下一页