T
TMXYB
Unregistered / Unconfirmed
GUEST, unregistred user!
我在gzan_chax_dll.dll中动态调用show_gzap_chax过程(此过程调用一个数据库查询窗口)时编译通过,但运行时出现错误
错误信息:Access Violation at adress 00000000,Read of address 00000000
程序代码如下:
procedure Tmain_rc_Form.Query_data_actionExecute(Sender: TObject);
var libhandle: Thandle;
show_gzap_chaxrocedure (Ahandle:Thandle;DataSetHandle:Integer);stdcall;
begin
libhandle := loadlibrary('gzan_chax_dll.dll');
try
if libhandle = 0 then
raise exception.Create('对不起!查询的动态连接库文件‘gzan_chax_dll.dll’丢失,请重新安装该文件!');
@show_gzap_chax := getprocaddress(libhandle,'show_gzap_chax');
if not (@show_gzap_chax = nil) then
[red]show_gzap_chax(main_rc_Form.Handle, INTEGER(Data_Module.gongz_anp_Query))//经调试此句出现错误![/red]
else
raiselastwin32Error;
finally
freelibrary(libhandle);
end;
end;
经查,并无大小写错误,如改为静态调用没有任何问题,请问是何故?
错误信息:Access Violation at adress 00000000,Read of address 00000000
程序代码如下:
procedure Tmain_rc_Form.Query_data_actionExecute(Sender: TObject);
var libhandle: Thandle;
show_gzap_chaxrocedure (Ahandle:Thandle;DataSetHandle:Integer);stdcall;
begin
libhandle := loadlibrary('gzan_chax_dll.dll');
try
if libhandle = 0 then
raise exception.Create('对不起!查询的动态连接库文件‘gzan_chax_dll.dll’丢失,请重新安装该文件!');
@show_gzap_chax := getprocaddress(libhandle,'show_gzap_chax');
if not (@show_gzap_chax = nil) then
[red]show_gzap_chax(main_rc_Form.Handle, INTEGER(Data_Module.gongz_anp_Query))//经调试此句出现错误![/red]
else
raiselastwin32Error;
finally
freelibrary(libhandle);
end;
end;
经查,并无大小写错误,如改为静态调用没有任何问题,请问是何故?