随笔分类 -  c++

摘要:一个异步模型的聊天程序服务器端:自定义消息(放在StdAfx.h文件里面即可)#define WM_SOCKET WM_USER + 1然后注册消(在VS2012里面可以自动完成注册和映射)afx_msg LRESULT OnSocket(WPARAM wParam, LPARAM lParam);... 阅读全文
posted @ 2014-04-27 23:36 Hacker_MJW 阅读(481) 评论(0) 推荐(0)
摘要:1、首先要明确,一共有两个文件需要下载,一个是winpcap安装文件用来实际操作http://www.winpcap.org/install/default.htm,另一个是winpcap开发包https://www.winpcap.org/devel.htm2、然后进行环境配置 把开发包解压后得WpdPack放在你的工程文件夹下,然后找到Configuration Properties->VC++ directories下的Include Directories和Libraries Directories下分别加入($SolutionDir)WpdPack/Include和($Solu 阅读全文
posted @ 2014-03-16 21:50 Hacker_MJW 阅读(2627) 评论(0) 推荐(0)
摘要:// WinService2.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include #include SERVICE_STATUS ServiceStatus; SERVICE_STATUS_HANDLE hStatus; void WriteLog(char *str){ FILE *log; log =fopen("G://log.txt", "a+"); if (log ==NULL) printf(&quo 阅读全文
posted @ 2014-03-16 14:47 Hacker_MJW 阅读(188) 评论(0) 推荐(0)