Hi all,
I have 2 classes Class1 and mainWindow. mainWindow has a function with the following signature:
Now Class1 has the WinMain entry point and it also has the WinProc procedure to deal with the messages. Now what I want to do is create a dialogue from a resource file which I have created and to tell it to use the DetectorProc function in the other class. I tried this but with no luck, this is in the WinProc procedure of Class1.Code:mainWindow::DetectorProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
However I get the following error message:Code:case WM_CREATE: { mainWindow = CreateDialog(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_GUIMAIN), hwnd, mainWindow::DetectorProc); if(mainWindow != NULL) { ShowWindow(mainWindow, SW_SHOW); } } break;
I tried doin the following but with no luck (it compiled fine but it seems tha the DetectorProc procedure wasnt getting the messages)Code:error C2664: 'CreateDialogParamA' : cannot convert parameter 4 from 'int (__stdcall mainWindow::*)(struct HWND__ *,unsigned in t,unsigned int,long)' to 'int (__stdcall *)(struct HWND__ *,unsigned int,unsigned int,long)'
Hopefully you can understand what im trying to do and can show me the right path as im pretty sure im not suppossed to use GetProcAddress as I have done above.Code:case WM_CREATE: { typedef int (CALLBACK *DetectorProc)(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam); DetectorProc dp; dp = (DetectorProc)::GetProcAddress((HINSTANCE)mainWindow, "DetectorProc"); mainWindow = CreateDialog(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_GUIMAIN), hwnd, dp); if(mainWindow != NULL) { ShowWindow(mainWindow, SW_SHOW); } } break;
Thanks for any help



LinkBack URL
About LinkBacks


