急~~~dephi调用labview生成的dll时报内存冲突~~~
labview 读取zigbee数据采集模块的数据,打包成dll我用delphi调用,报内存冲突。access violation at 0x300053e0:read of address 0x00000000'
但是用VC调用同样的DLL却没有问题。请问是为什么?
程序如下:(动态调用dll)
private
public
end;
type td1=record
elt1:double;
elt2:double;
elt3:double;
elt4:double;
end;
PTD1=TD1;
Tzigbee1=procedure(zigbee:PTD1);stdcall;
implementation
procedure DAQ1;external 'SharedLib.dll';
procedure Tform1.button1click(sender:tobject);
var midWare:TD1;
dllhandle:thandle;
pro:Tzigbee1;
begin
dllhandle:LoadLibrary('SharedLib.dll');
try
@pro:=getprocAddress(DllHandle,'zigbee1');
if assigned(@pro) then
begin
pro(midWare);
memo1.lines.add(floattostr(midware.elt1))
end;
finally
freeLibrary(dllhandle);
end;
end;
我单步调试,程序运行到最后一句都没有错,再执行 就报刚刚的内存突冲。
哪位高手给解答一下嘛,急死了。
我把我所有的分都拿出来了,如果解决了,我去挣分再给您补多一些。不胜感激;