|
本帖最后由 aau007 于 2016-12-3 11:16 编辑
DLL API结构动态数组赋值问题。。。
bool TdxHq_GetSecurityQuotes(byte Market[], char* Zqdm[], short& Count, char* Result, char* ErrInfo);//DLLapi c语言函数原型
我用aardio转换工具自动转换为:
TdxHq_GetSecurityQuotes= dll.api("TdxHq_GetSecurityQuotes","bool(byte Market[], string Zqdm[], word& Count, string Result, string ErrInfo)");
用于看手册说API数组参数要 结构体传数据,我就改成下面的定义:
var TdxHq_GetSecurityQuotes = TdxHq.api("TdxHq_GetSecurityQuotes","bool(struct Market, struct Zqdm, word &Count, String &Result, String &ErrInfo)","stdcall");
market = class {
struct mark = { byte [10] ; }
}
zqdm = class{
struct dm = { string [10] ;}
}
var Market1 = market()
Market1.mark = {0;1};
var Zqdm1 = zqdm();
Zqdm1.dm = {"300031" ; "00688"};
var Count = 2;
boolret,Result,ErrInfo = TdxHq_GetSecurityQuotes(Market1, Zqdm1, 2, 65535, 256);
if (!boolret)
{
thread.command.print(string.fromto(ErrInfo,0,65001));
return;
}
thread.command.print(string.fromto(Result,0,65001) );
结果调用未成功,本人aardio刚入门,希望高手看看,哪里定义出错了? |
|