T
toli
Unregistered / Unconfirmed
GUEST, unregistred user!
从一个dll中导入后有一函数:
procedure AddItems(NumItems: Integer; var ItemIDs: PSafeArray; var ClientHandles: PSafeArray;
out ServerHandles: PSafeArray; out Errors: PSafeArray;
RequestedDataTypes: OleVariant; AccessPaths: OleVariant); safecall;
在调用它的时候返回不正确,具体调用方法是:
var
ItemIDs: OleVariant;
ItemClientHandles: OleVariant; // Array for returned Item related errors
Errors : OleVariant;
begin
//......
ItemIDs:= VarArrayCreate([0, 1], varVariant);
ItemClientHandles:= VarArrayCreate([0, 1], varVariant);
Errors:= VarArrayCreate([0, 1], varVariant);
ItemIDs[0] := txtItem1.Text;
ItemIDs[1] := txtItem2.Text;
ItemClientHandles[0] := 1;
ItemClientHandles[1] := 2;
MyItems.AddItems(2,PSafeArray(TVarData(ItemIDs).VArray),
PSafeArray(TVarData(ItemClientHandles).VArray),
PSafeArray(TVarData(MyItemServerHandles).VArray),
PSafeArray(TVarData(Errors).VArray),
EmptyParam, EmptyParam);
经检查,AddItems调用是不成功的.
希望高手们指导!谢谢!
(我用的dll是西门子的sopcdaauto.dll) :<
procedure AddItems(NumItems: Integer; var ItemIDs: PSafeArray; var ClientHandles: PSafeArray;
out ServerHandles: PSafeArray; out Errors: PSafeArray;
RequestedDataTypes: OleVariant; AccessPaths: OleVariant); safecall;
在调用它的时候返回不正确,具体调用方法是:
var
ItemIDs: OleVariant;
ItemClientHandles: OleVariant; // Array for returned Item related errors
Errors : OleVariant;
begin
//......
ItemIDs:= VarArrayCreate([0, 1], varVariant);
ItemClientHandles:= VarArrayCreate([0, 1], varVariant);
Errors:= VarArrayCreate([0, 1], varVariant);
ItemIDs[0] := txtItem1.Text;
ItemIDs[1] := txtItem2.Text;
ItemClientHandles[0] := 1;
ItemClientHandles[1] := 2;
MyItems.AddItems(2,PSafeArray(TVarData(ItemIDs).VArray),
PSafeArray(TVarData(ItemClientHandles).VArray),
PSafeArray(TVarData(MyItemServerHandles).VArray),
PSafeArray(TVarData(Errors).VArray),
EmptyParam, EmptyParam);
经检查,AddItems调用是不成功的.
希望高手们指导!谢谢!
(我用的dll是西门子的sopcdaauto.dll) :<