ISAPI与窗体如何通讯?

King 2000-02-13 06:23:00
ISAPI与窗体如何通讯?
我想用ISAPI实现一个聊天室,因为不想频繁读硬盘,所以想以一个窗体作为储存数据之用,同时实现一些监视功能。具体如何实现?

新年快乐^O^
...全文
147 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
DOU 2000-02-14
  • 打赏
  • 举报
回复
MSDN里的一段说明:

Win32 DLLs are mapped into the address space of the calling process. By default, each process using a DLL has its own instance of the DLL global and static variables. If your DLL needs to share data with other Win32 DLLs loaded by a different application or with different mappings of the same DLL, then you can use either of the following approaches:

Create named data sections using the #pragma statement.


Use memory-mapped files.
To set up a new named section, use the #pragma data_seg directive. You then must specify the correct sharing attributes for this new named data section in your .DEF file. For more information about creating named data sections, see the following Knowledge Base articles:

"How to Share Data Between Different Mappings of a DLL" (Q125677).


"Specifying Shared and Nonshared Data in a DLL" (Q100634).


"How to Specify Shared and Nonshared Data in a DLL" (Q89817).


"Sharing All Data in a DLL" (Q109619).
However, if you need to share a C++ class instance, you should use a memory-mapped file, because each time a process attaches to the DLL, the constructor for the object is called. For example:

#pragma data_seg(".myseg")
_declspec(dllexport) CTest Counter1(0);
_declspec(dllexport) short Counter2 = 0;
#pragma data_seg()

Assume that the variables Counter1 and Counter2 are incremented in a function in the DLL. The value of Counter2 increases as expected, but on each process attach, the constructor for Counter1 is called reinitializing it to zero. In order to share Counter1, you must use a memory-mapped file. For more information about memory-mapped files, seeFile Mapping in the Win32 SDK documentation.

King 2000-02-13
  • 打赏
  • 举报
回复
某种内存共享机制是什么?具体一点
DOU 2000-02-13
  • 打赏
  • 举报
回复
用ISAPI生成的ISAPI DLL运行于IIS进程中,不可能有界面,它可以实现所有服务器端不涉及界面的一般应用程序完成的功能。不知用窗体储存数据是什么意思?利用某种内存共享机制,可以将数据存于内存中。

16,466

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Web++
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧