上一页 1 2 3 4 5 6 7 8 ··· 13 下一页
  2014年5月21日
摘要: DLL有个共同的特点就是都有一个初始化函数,一个资源释放函数,其他几个函数都是核心功能函数。而且这些DLL有时会被多个进程同时调用,这就牵扯到多进程的多线程调用DLL的问题。有点绕口,以下我根据我实践中遇到的问题,分四种情况分享一下我解决此类问题的经验:1、动态库只有一个导出函数。这种情况非常少,也... 阅读全文
posted @ 2014-05-21 18:05 上海—Michael 阅读(1379) 评论(0) 推荐(0) 编辑
摘要: Socket中常见的几个转换函数(htonl,htons,ntohl,ntohs,inet_addr,inet_ntoa) htonl() htons() ntohl() ntohs()及inet_ntoa() inet_addr()的用法 注:其中的h表示“host”,n表示“net”,l表... 阅读全文
posted @ 2014-05-21 10:41 上海—Michael 阅读(1694) 评论(0) 推荐(0) 编辑
  2014年5月20日
摘要: #include "stdafx.h"#include #include #pragma comment(lib,"ws2_32.lib")using namespace std;int main(int argc, char* argv[]){ WSADATA wsaData; int... 阅读全文
posted @ 2014-05-20 22:47 上海—Michael 阅读(535) 评论(0) 推荐(0) 编辑
摘要: 转自:http://blog.sina.com.cn/s/blog_71b3a9690100usem.html由于自己在写进程间通信的相关程序,查阅了关于资料。觉得命名管道方法实现通信是不错的选择,可是对于其使用方式却有诸多的不解。同步方式、异步方式、重叠方式………..有很多的不解。首先是关于Wai... 阅读全文
posted @ 2014-05-20 12:29 上海—Michael 阅读(2866) 评论(0) 推荐(1) 编辑
  2014年5月19日
摘要: #include "stdafx.h"#include#include#includeusing namespace std;DWORD WINAPI thread1(LPVOID param){ char buf[256]; DWORD rlen=0; HANDLE hPipe ... 阅读全文
posted @ 2014-05-19 16:46 上海—Michael 阅读(772) 评论(0) 推荐(0) 编辑
摘要: 服务器: 1 #include "stdafx.h" 2 #include 3 #include 4 #include 5 #include 6 7 #define BUFSIZE 512 8 9 DWORD WINAPI InstanceThread(LPVOI... 阅读全文
posted @ 2014-05-19 15:34 上海—Michael 阅读(775) 评论(0) 推荐(0) 编辑
摘要: _tprintf() 是 printf() 和 wprintf() 的通用类型;如果定义了 _unicode,那么 _tprintf() 就会转换为 wprintf(),否则为 printf() 。在这 3 个函数中有两个字符串控制输出字符为 %s 和 %S 。使用它们时,有如下区别:%s当使用 p... 阅读全文
posted @ 2014-05-19 15:22 上海—Michael 阅读(11239) 评论(0) 推荐(1) 编辑
  2014年5月18日
摘要: 匿名管道父进程#include#includemain(){HANDLEread=NULL,write=NULL;//定义两句柄SECURITY_ATTRIBUTESss;STARTUPINFOsa={0};PROCESS_INFORMATIONpp={0};//定义结构体SECURITY_ATTR... 阅读全文
posted @ 2014-05-18 00:00 上海—Michael 阅读(1006) 评论(0) 推荐(0) 编辑
  2014年5月15日
摘要: 详细见MSDN:http://msdn.microsoft.com/en-us/library/windows/desktop/ms686903%28v=vs.85%29.aspx我们已经看到,当想让写入者线程和读取者线程以独占的方式或共享的方式访问一个资源的时候,可以使用SRWLock。在这些情况... 阅读全文
posted @ 2014-05-15 11:24 上海—Michael 阅读(1736) 评论(0) 推荐(0) 编辑
  2014年5月14日
摘要: 要在Visual C++2012 中使用OpenMP其实不难,只要将 Project 的Properties中C/C++里Language的OpenMP Support开启(参数为 /openmp),就可以让VC++2005 在编译时支持OpenMP 的语法了;而在编写使用OpenMP 的程序时,则... 阅读全文
posted @ 2014-05-14 10:51 上海—Michael 阅读(412) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 13 下一页