Description: 共四个演示。分别如下:
1:Sample
一个简单的使用了共享内存映射的例子,运行两个实例看看就知道,没有什么特别。
2:SendText
不用窗口子类化,而达到和发送自定义消息同样的效果。
3:SendFile
由于演示2中还是通过发消息来传递字符串,不可能传递大块文本,本例综合演示1和演示2达到传递大块文本的功能。
4:Chat
演示2和演示3使用的都是SendMessage来发放通知消息,所以不能异步通讯,SetWindowText不能跨进程使用,PostMessage只能在WM_USER以上的自定义消息中才能传递指针,那么如何才能异步通讯呢?我还没有好主意,就用定时器吧!看看这个可以聊天的程序就知道了。
Common目录下有四个模块。
其中ShareStr2.cls是原来大师Bruce MicKenney写的东西,就是这个东西害我浪费很多时间来调试。原来大师的东西也会有错。-a total of four demonstration. Respectively, as follows : 1 : Sample a simple use of shared memory mapping example, look at two examples run, we know that nothing special. 2 : SendText not window-type, and to achieve this definition of news from the same effect. 3 : As demonstrated SendFile 2 updates, or to pass through the string, impossible to send large text, the cases demonstrate a comprehensive and demonstration to send two large text functions. 4 : Chat demonstration two and three demonstration SendMessage are used to notify the news release, it is not asynchronous communications, inter-process SetWindowText not use, PostMessage WM_USER only in the above-defined messages can transfer target, How can we asynchronous communication? I have not a good idea, on the timer! Chat can look at Platform: |
Size: 52224 |
Author:cohoo |
Hits: