Original Post
I''m attempting to implement a class that defines a special type of dialog box however when I attempt to create it as a modeless box within the implementation file of my class as such:
void CDlg::CreateCDialog(HWND inparent, HINSTANCE maininst)
{
parent = inparent;
CWin = CreateDialog(maininst, MAKEINTRESOURCE(IDD_MAIN), parent, CProc);
}
I get this error:
"error C2664: ''CreateDialogParamA'' : cannot convert parameter 4 from ''int (struct HWND__ *,unsigned int,unsigned int,long)'' to ''int (__stdcall *)(struct HWND__ *,unsigned int,unsigned int,long)''
My procedure is defined as a member function of the class and is in the same file. When not implemented in a class this works just fine as normal. However when I make the procedure''s prototype in the header file and then implement the proc function as such:
BOOL CALLBACK CDlg::CProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
}
it gives the above error. I don''t really understand how __stdcall works into this. All I know is that when I comment out the proc function''s prototype in the header file and then make it just
BOOL CALLBACK CProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
}
it works, but I can''t access the members of my class obviously (which is quite annoying). This seems really easy to fix I just can''t see it ...any ideas? (sorry if this was long, it''s hard to explain in one or two sentences)