I'm having a problem getting forward declaration to work (actually I'm not sure if it should work the way I intend).
I have a cpp file as follows:
int DialogModeless::Create(int dialogID, Presenter* pPresenter)
{
Ptrs* pPtrs = new Ptrs;
pPtrs->pPresenter = pPresenter;
pPtrs->pWnd = _derived;
HINSTANCE hInstance = ::GetModuleHandle(NULL);
_hWnd = ::CreateDialogParam(hInstance, MAKEINTRESOURCE(dialogID), NULL, &Presenter::StatDlgProc,
reinterpret_cast<LPARAM>(pPtrs));
return 0;
}
Now the way I have it is that Presenter::StatDlgProc need only be declared at this point since I am only taking its address. This does not seem to be the case as I am getting the following error from Visual Studio 2008:
error C2027: use of undefined type 'Presenter'
I have to include Presenter.h for the code to compile.
Can anyone explain this to me?
I tried to forward declare like this:
class Presenter;
BOOL CALLBACK Presenter::StatDlgProc(HWND, UINT, WPARAM, LPARAM);