我用WIN32 DLL建立DLL,目的是在VB与VC编译的.EXE程序之间进行实时传输数据,在网上查过首先创建一个有名的数据区。这在Visual C++中是使用data_seg pragma宏。
我的程序:
#include <string.h>
#include <stdio.h>
#pragma data_seg(".MYSEC")
char MySharedData[4096]={0};
#pragma data_seg()
void __stdcall SetData(LPSTR s)
{
strcpy(MySharedData, s);
}
void __stdcall GetData(LPSTR s)
{
strcpy(s, MySharedData);
} 但是报错很多,请高手指导啊
我的程序:
#include <string.h>
#include <stdio.h>
#pragma data_seg(".MYSEC")
char MySharedData[4096]={0};
#pragma data_seg()
void __stdcall SetData(LPSTR s)
{
strcpy(MySharedData, s);
}
void __stdcall GetData(LPSTR s)
{
strcpy(s, MySharedData);
} 但是报错很多,请高手指导啊
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货