The ultimate solution to Dax error of Delphi ActiveX

Source: Internet
Author: User

Generally, Dax error is interpreted as follows: in Delphi ActiveX, a process has only one parkingwindow, And the parkingwindow function of axctrls. PAS in VCL needs to be modified:

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: = createmediawex (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;

However, if the preceding modification does not solve all the problems, a Dax error will still be reported. After debugging and testing, the problem is found in the sentence "If result <> 0 Then exit, you also need to comment out or remove it and re-compile it.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.