Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How create a custom email dialog settings in transportdemo

1 view
Skip to first unread message

Magi

unread,
Sep 15, 2009, 9:03:16 AM9/15/09
to
Hi all,
I'm using a custom mail transport derived from the Microsoft example
TransportDemo dll.
My goal is create a custom mfc dialog for the email settings, with a
less number of fields of the usual IMAP/POP settings.
Reading inside the transportdemo I see that I have to implement the
DoProperties() method and set the kszCapPropDialog to 1.
Basically I think it should be like to have an executable (tmail.exe)
that opens an mfc dialog from a dll (transportdemo.dll)

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


0 new messages