• Advertisement
Sign in to follow this  

Dialog Wrapper .... -.^ slight problem

This topic is 3926 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Well this problem is well rather intresting i decided i needed to write a class wrapper for Dialog boxs so i could use a template Dialog box and dynamicly create as many or as few as were needed. The only problem i seem to be having is the last argument of CreateDialog Each DialogProc belongs to its own class iv been scratching and trying to get this to work for oh a good hand full of hours now So heres the code below ill try to explain abit of it as best i can HINSTANCE GhInstance; class Window { public: HWND hwnd; bool SetupWindow(); bool CALLBACK DialogProc (HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam) { switch(message) { case WM_INITDIALOG: return true; case WM_COMMAND: switch(wParam) { case IDOK: EndDialog(hwnd, 0); return true; break; } break; } return 0; } }; bool Window::SetupWindow() { CreateDialog(GhInstance,MAKEINTRESOURCE(IDD_DIALOGTEMPLATE),hwnd,(DLGPROC)DialogProc); } Normaly Casting the DialogProc is usaly easy enough i figured it would get tricky but i oveusly did not have a clue. its pritty bare bones the only things wrong with it is CreateDialog(GhInstance,MAKEINTRESOURCE(IDD_DIALOGTEMPLATE),hwnd,(DLGPROC)DialogProc); The last peramater gives me a few intresting a errors amoung the differnt things i have tryed Any suggestions would be helpful thanks alot This is Win32 C++

Share this post


Link to post
Share on other sites
Advertisement
Man i cant belive i overlooked that... well thanks alot lol its appears to working so far!

Thanks a million !

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement