Detecting Multiple Instances of an Appli - 项目摘要 |
摘要
| 管理 |
论坛 文档
| 软件包 |
|
|
|
项目描述: |
This is a very simple way to detect the running instance of an application. It can be achieved by declaring a data variable in the compiler's own data section called shared.
#pragma data_seg("Shared")
LONG g_Counter = -1;
#pragma data_seg()
After this, the Linker will be noticed to make the Shared section readable, writable, and shared.
#pragma comment(linker, "/section:Shared, rws")
这个简单的例子用于检测一个应用程序的运行实例。可以通过在编译器自己的共享数据段中声明一个数据变量来实现。
#pragma data_seg("Shared")
LONG g_Counter = -1;
#pragma data_seg()
之后,链接器可以对共享段进行读、写和共享操作。
#pragma comment(linker, "/section:Shared, rws")
来源: http://www.codeguru.com/system/multiple.html |
类别: |
|
发布者:
cbd002
|
|
最新发布源码包 |
软件包 |
版本号 |
日期 |
本地下载 |
multiple |
 1.0  |
2004-03-30 |
下载 |
|
|