Here is my implementation of the DoProperties() method.
HRESULT CTransportSyncHandler::DoProperties(HWND hwndParent)
{
AFX_MANAGE_STATE(AfxGetAppModuleState());
AfxSetResourceHandle(g_hInst); // g_hInst is the HINSTANCE of the
// transportdemo dll
CWnd wndParent;
if (!wndParent.Attach(hwndParent) ) {
AfxAbort();
}
// CSettings is my simple dialog class and it is instantiate OK
CSettings settings(&wndParent);
// DoModal() fail with debug assertion
if (settings.DoModal() == IDOK ) {
// nothing to do
}
wndParent.Detach();
return 0;
}
Basically, I'm able to instantiate my own CSettings dialog but when the
DoModal() is called, I got a Microsoft assert window error
"Program: \Windows\tmail.exe
File: f:\sp\vctools\vc7libsce\ship\atlmgc\include\afxwin1.inl
Line: 21
"
Is there anyone that already encountered this problem or can give me any
hint about how to solve this issue?
Thank you very much in advance.
Magi