fix DAX error(解决delphi编写的ocx控件中的DAX error问题)

博客指出在Win2、WinXp系统使用Internet Explorer时,ActiveForm或ActiveX控件会引发DAX错误,原因是Delphi的OCX使用相同的停车窗口过程。解决办法是编辑Delphi VCL源程序axctrls.pas并编译,将axctrls.dcu复制到lib目录,还给出了axctrls.pas中的相关代码。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

when using Internet Explorer in Wink2, WinXp, ActiveForm or ActiveX control raise

DAX error : access violation at address 000

reason :

delphi's ocx use same parking window procedure.

one ocx must use individual parking window proc.

fix error.

edit delphi VCL source routine in axctrls.pas

and compile axctrls.pas 

copy axctrls.dcu to lib directory.

axctrls.pas

function ParkingWindow: HWND; 

var 

TempClass: TWndClass; 

ParkingName : String; 

begin 

Result := xParkingWindow; 

if Result <> 0 then Exit; 

// fix Dax error : accessviolation (win2k, win xp) 

ParkingName := 'DAXParkingWindow_' + Format('%p', [@ParkingWindowProc]); 

FillChar(TempClass, sizeof(TempClass), 0); 

if not GetClassInfo(HInstance, PChar(ParkingName), TempClass) then // fix Dax error : accessviolation (win2k, win xp) 

begin 

TempClass.hInstance := HInstance; 

TempClass.lpfnWndProc := @ParkingWindowProc; 

TempClass.lpszClassName := PChar(ParkingName); // fix Dax error : accessviolation (win2k, win xp) 

if Windows.RegisterClass(TempClass) = 0 then 

raise EOutOfResources.Create(SWindowClass); 

end; 

xParkingWindow := CreateWindowEx(WS_EX_TOOLWINDOW, TempClass.lpszClassName, nil, 

WS_POPUP, GetSystemMetrics(SM_CXSCREEN) div 2, 

GetSystemMetrics(SM_CYSCREEN) div 2, 0, 0, 0, 0, HInstance, nil); 

SetWindowPos(xParkingWindow, 0, 0, 0, 0, 0, SWP_NOACTIVATE or SWP_NOREDRAW 

or SWP_NOZORDER or SWP_SHOWWINDOW); 

Result := xParkingWindow; 

end; 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

__Ray__

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值