Help with access violation reading location (exception)

  • Thread starter Thread starter poiuzt12321
  • Start date Start date
P

poiuzt12321

Guest
I have this lines of code:

old_evhndl = *(FARPROC*)obj->old_eventhandler();
....
return CallWindowProc(old_evhndl, hwnd, msg, (WPARAM)wParam, (LPARAM)lParam);


The exception points to the last line and shows me this:

Exception thrown at 0x00007FF9F23F5260 (user32.dll) in filetool.exe: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF.


I know that there is a problem with pointer conversions. What I could observe is that when I comment the first line out there is no exception. So I guess there is a problem with this

(FARPROC)obj->old_eventhandler();

old_eventhandler() has a void* as a return type. It is defined like this:

#ifndef _GwGUI_MOTIF
virtual void* old_eventhandler() { return NULL; }


old_evhndl is defined like this:

static FARPROC old_evhndl = NULL;


STRICT is not defined so CallWindowProc is expecting a FARPROC as the first argument.

Continue reading...
 
Back
Top