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

samool 发布暂无评论12293 阅读

AI摘要

文章介绍了如何解决在使用Internet Explorer时,由Delphi编写的ActiveForm或ActiveX控件引发的DAX错误。错误原因是Delphi的OCX控件使用了相同的停车窗口过程,导致访问冲突。解决方法是编辑Delphi VCL源代码中的axctrls.pas文件,重新编译后将生成的axctrls.dcu文件复制到lib目录下。具体步骤包括修改ParkingWindow函数,为每个OCX控件分配一个独立的停车窗口过程,以避免访问冲突。

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;

ocx · dax
  1. 01解决VB写的OCX在Delphi中的导入问题2011-08-12
  2. 02Delphi不能导入已经注册的OCX ActiveX2011-08-11
  3. 03SaMDeditor V2.4 更新内容2026-12-02
  4. 04恭喜《轻武爱学习》小程序备案成功!2026-11-24
  5. 05SaView 图阅 1.1.1 更新日志2026-11-18
  6. 06Book2EPUB 1.0.4 更新日志2026-11-18
  7. 07SaView 图阅 一款轻便纯粹的看图工具2026-11-16
  8. 08免费工具Book2EPUB:轻松将电子书转换为 EPUB2026-11-11
  9. 09SaBlog2026 主题功能介绍(v1.1.36)2026-10-26
  10. 10PHP2Shell 重大安全漏洞事件深度分析报告2026-10-23
COMMENTS / 一纸留言

读者留言 0 条

一纸留言,便是山水间的一次相逢。

还没有留言,欢迎写下第一段交流。

WRITE A COMMENT

写下你的留言