After playing around lots ive seen lots of other peoples implementations...
Anyway i thought because i only acctually need one wndproc and i dont fancy implementing a complete windows managment system when i dont 100% understand it all...
so i thought about making the normal window proc in winmain like so:
LRESULT CALLBACK Window_Message_Pump(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);LRESULT CALLBACK Window_Message_Pump(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam){ switch(uMsg) { .... }}
then i thought why not just make the wndclassex object in winmain then send it over to my class for processing... like so:
WNDCLASSEX wndClassEx; wndClassEx.lpfnWndProc = (WNDPROC)Window_Message_Pump; oWindow->Set_WndClass(&wndClassEx); ....
so then the class that oWindow is an instance of holds the pointer to the wndproc already so only the other wndclass attributes need setting... anyway i tried this method and it kicks up a fuss on CREATEWINDOW function, although REGISTERCLASS function works fine...
i get the following error when i call CREATEWINDOW:
Unhandled exception at 0x004137f1 in TTest.exe: 0xC0000005: Access violation writing location 0xcdcdcdcd.
Is this because im passing over the wndclassex? i wouldnt think it would matter as a pointer ultimatly just points at a chunk of memory so it doesnt matter where its pointing to in the code, as long as the object is still in memory it can access it...
Any help would be great :D