发布于 2011-05-24 03:50:31
13楼
斑竹,DLL引用结构体返回在WINCC里面怎么取出成员值和WINCC中的变量值对应?
以下为DLL中结构体的定义例程,错误在哪里?不知道如何返回结构体和WINCC中如何引用结构体的成员.
extern "C" __declspec (dllexport) struct aufruf1 (int a);
#include
#include
FILE *h_test;
FILE *h_trace;
extern "C" __declspec (dllexport) struct aufruf1(int a)
{
struct stationinfo
{
int type ;
int port;
char * ip;
char * addr;
};
switch(a)
{
case 1:
{
stationinfo stationinfo_1;
stationinfo_1.type=1111;
stationinfo_1.port=6021;
stationinfo_1.ip="192.168.1.10";
stationinfo_1.addr="r";
return stationinfo_1;
}break;
case 2:
{
stationinfo stationinfo_2;
stationinfo_2.type=2222;
stationinfo_2.port=6022;
stationinfo_2.ip="192.168.1.11";
stationinfo_2.addr="y";
return stationinfo_2;
}break;
default:
{
}break;
}
}