I'm writing a Win32 app with VC 2005 unmannaged code.
I started a new project from scratched.
I want to have a class for the Dialog form that handle everyting for that form (processing messages and so on...).
In the WinMain() I want to create an object of the class I wrote.
Because DefProc is a CALLBACK function, i'm having hard time to change it to be another method in my form class.
I want to be able to create multiple instances of the same class.
How to change this DlgProc as a class method?
Thanks in advanced, Rami.
here is the Dialog Procedure that I want to make a class method:
Expand|Select|Wrap|Line Numbers
- LRESULT CALLBACK dlgTest_DlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam, LPARAM dwInitParam )
- {
- switch( uMsg )
- {
- //case WM_INITDIALOG : //Initilize the form controls.
- case WM_COMMAND :
- ControlEvents(LOWORD(wParam), HIWORD (wParam));
- return TRUE;
- case WM_CLOSE:
- PostQuitMessage(0);
- return FALSE;
- case WM_DESTROY:
- DestroyWindow (hDlg);
- return FALSE;
- default :
- return( FALSE );
- }
- return( FALSE );
- }