DialogBox Argument Invalid?
Hi, i searched around for all the dialog box problems on forum, and none seem to help me.
The error i get is this:
argument of type `BOOL (CppWnd::)(HWND__*, UINT, WPARAM, LPARAM)' does not match `BOOL (*)(HWND__*, UINT, WPARAM, LPARAM)'
I'm sure that my program being in a really big Class, there are some variable losses or something going on. Heres the code:
In my OnCommand Function, which is called from the Case WM_COMMAND, i have this incase someone presses "about"
Code:
if((nID == IDD_ABOUTBOX) && (uNotifyCode == BN_CLICKED)){
DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_ABOUTBOX), hAppWnd, (DLGPROC)AboutDlgProc);
}
hAppWnd is my HWND... IDD_ABOUTBOX HAS been defined.
I've declared the prototype in my header file too. Same way. My AboutDlgProc function is CppWnd::AboutDlgProc, and is BOOL CALLBACK.
However, i keep getting this error, i've tried every possible thing, but it doesnt work.
I think perhaps, the UINT Message, wParam and lParam are getting lost because I dont have DialogBox() inside the WndProc function under WM_COMMAND. But i am not sure.
ABOUT CODE:
Code:
BOOL CALLBACK CppWnd::AboutDlgProc(HWND hAppWnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
switch(Message)
{
case WM_INITDIALOG:
return TRUE;
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDOK:
EndDialog(hAppWnd, IDOK);
break;
case IDCANCEL:
EndDialog(hAppWnd, IDCANCEL);
break;
}
break;
default:
return FALSE;
}
return TRUE;
}