网站上有个例程,可以正常调用,而这次应用是多参数返回,有字符串(中英文都有),有整形数,请问各位大侠如何实现.
以下为例子:
extern "C" __declspec (dllexport) int aufruf1 (int a,int b );
#include
#include
FILE *h_test;
FILE *h_trace;
extern "C" __declspec (dllexport) int aufruf1(int a ,int b )
{
switch(a)
{
case 1:
{a=100;
b=111;
} break;
case 2:
{a=200;
b=333;
} break;
case 3:
{a=300;
b=333;
} break;
default:
{a=999;} break;
}
return a;
return b;
例程里面单个参数返回值的WINCC调用如下:
#pragma code ("e:/20110520.dll")
int aufruf1(int a);
#pragma code ()
int value;
value = GetTagWord("NewTag"); //Return-Type: WORD
SetTagWord("NewTag_1",aufruf1(value)); //Return-Type: BOOL