I have a custom TPanel
that handles WMNCHitTest
. At runtime, when mouse enters the panel, I get the following AV:
Project ClientDatasetEditor.exe raised exception class $C0000005 with message 'access violation at 0x00405219: read of address Ox0000000c'
The Call Stack shows:
> :00405219 SysGetMem + $30 • :0040b7c6 @DynArraySetLength + $A • :005394e7 TWinControl.MainWndproc + $2F • :004c945a StdWndProc + $16 • :76ff7694 user32.CaIINextt-iookEx + 0x97 • :76ff8baa; C: \WIND0WSysWOW64iser32.dII • :76ff8468; C:\WINDOWSysW0W64iser32.dII • :76ff9c40 user32.DispatchMessageW + Ox1O
Follows WMNCHitTest
handle:
procedure tExGraphicControl.WMNCHitTest(var Message: tWMNCHitTest);
begin
inherited;
if not (csDesigning in ComponentState) or
(msOver in fMouseStates ) then Exit;
if Message.Msg = WM_NCRButtonUp then begin
fMouseStates := [msLeftUp];
Exit ;
end;
if Message.Msg = WM_NCMBUTTONUP then begin
fMouseStates := [msLeftUp];
Exit ;
end;
if IsMouseOverControl (Self) then begin
fMouseStates := [msOver, msMove];
if Assigned (fOnMouseEvent) then
fOnMouseEvent (Self, fMouseStates);
end;
end;
Any idea about what's causing the AV?