|
其中函数SendData的格式如下:
SendData(sUserid,sPasswd,sSvccode,sMsg:PChar;var sRef:PPChar;var sLen:PLongInt):Integer;
输入的4个参数sUserid、sPasswd、sSvccode、sMsg:PChar 类型分别为string ,string,string,char*
在输入参数中返回参数sRef:PPChar、sLen:PLongInt类型为char**和long int类型
函数的返回类型是整型int
执行之后一直报错: exit code:3221225477
在线等求大神帮忙....................................................................................
下面附上代码:
local $user="username" ;第一个参数
local $password="passwordnumber" ;第二个参数
local $code="Trade_001" ;第三个参数
local $inparam="hehe"
$arraydata=StringSplit($inparam,"")
Local $stString = DllStructCreate("char var[128]") ;第四个参数
DllStructSetData($stString,"var","")
local $len=1
struct ptr { char fname[200])
$s = DllStructCreate("ptr ppfname;ptr pfname;char fname[200]")
DllStructSetData($s, 3, $arraydata) ;给第3项赋值
$p1 = DllStructGetPtr($s, 3) ; p1 = address of fname (char*)
DllStructSetData($s, 2, $p1) ; set "address of fname" to pfname (char**)
$p2 = DllStructGetPtr($s, 2)
DllStructSetData($s, 1, $p2)
$p3 = DllStructGetPtr($s, 1)
local $result = DllCall("KSBClient.dll","int","SendData","str",$user,"str",$password,"str",$code,"ptr",DllStructGetData($stString,1),"ptr",DllStructGetData($s,1),"int64",$len)
#region 释放结构的资源
$stString = 0
$s = 0
#EndRegion
If @error = 0 Then
MsgBox("","","In")
MsgBox("", "Ok", $result[0])
EndIf |
|