为什么LoadLibrary在普通程序可以成功,而在activeform中不行呢?(100)

J

jxh_ty

Unregistered / Unconfirmed
GUEST, unregistred user!
LoadLibrary(dll)在普通程序返回>0的值,在activeform中却返回0,为何?怎样解决?
 
F

fishhao

Unregistered / Unconfirmed
GUEST, unregistred user!
什么 activeform ? 建议代码贴出来
 

轻舞肥羊

Unregistered / Unconfirmed
GUEST, unregistred user!
权限问题吧,activeform一般是网页调用,系统不允许它访问用getlasterror看下错误代码就知道了
 

天真

Unregistered / Unconfirmed
GUEST, unregistred user!
把DLL绝对路径整上看看.
 
J

jxh_ty

Unregistered / Unconfirmed
GUEST, unregistred user!
在activeform控件中,使用动态加载DLL方法,以下代码报错“Access violation at address....”,这是什么问题?type TIntFunc=function(szDevName: LPCSTR;
phCard: pointer):DWORD;
stdcall;
var hHandle:pointer;
Th:Thandle;Tf:TIntFunc;Tp:TFarProc;aa:DWORD;begin
Th:=LoadLibrary('c:/dll/HD_GPAPI.dll');
{装载DLL}if Th>0 then
tryTp:=GetProcAddress(Th,'HSConnectDev');if Tp<>nilthen
begin
aa:=Tf('USB1',hHandle);Edit1.Text:=IntToStr(aa);////////用Edit1.Text:=IntToStr(GetLastError);发现GetLastError的结果为6用ShowMessage(SysErrorMessage(GetLastError));显示结果为句柄无效。
 
D

ddzhouqian

Unregistered / Unconfirmed
GUEST, unregistred user!
不可能,activex调用过dll,没有任何问题
 
J

jxh_ty

Unregistered / Unconfirmed
GUEST, unregistred user!
activeform 的ocx在IE8中不能用,怎么解决?
 

Similar threads

S
回复
0
查看
913
SUNSTONE的Delphi笔记
S
S
回复
0
查看
743
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
顶部