调用labview写地DLL大家帮我看看哪里出错了(11)

  • 主题发起人 baiqplssy
  • 开始时间
B

baiqplssy

Unregistered / Unconfirmed
GUEST, unregistred user!
delphi 调用labview 写地DLLlabview 声明#include "extcode.h"#pragma pack(push)#pragma pack(1)#ifdef __cplusplusextern "C" {#endiftypedef struct { long dimSize; LStrHandle ComboBox[1]; } TD1;typedef TD1 **TD1Hdl;void __stdcall Test(TD1Hdl *Input, long index, char Output[], long len);long __cdecl LVDLLStatus(char *errStr, int errStrLen, void *module);#ifdef __cplusplus} // extern "C"#endif#pragma pack(pop)-----------------------------------------------------begin
type TArry = Array of string;
Tfunc = procedure(aArry:TArry;index:integer;str:string;len:integer);stdcall;var aArry: TArry;
index,len: integer;
str: string;
dllHandle: THandle;
func: Tfunc;
begin
dllHandle := loadLibrary('SharedLib.dll');
if dllHandle <> 0 then
begin
@func := GetProcAddress(dllHandle,'Test');
if @func <> nil then
begin
setlength(aArry,4);
aArry[0] := 'gdsgds';
aArry[1] := 'gggggg';
aArry[2] := 'hhhhhhhh';
aArry[3] := 'kkkk';
func(aArry,0,str,10);
end;
end else
raise exception.Create('不能装载该DLL');
end;
运行到这里出错 func(aArry,0,str,10);是不是我的接口声明函数有问题 应该怎么声明?
 
顶部