Platform: Windows Mobile 6
Application: Pocket Outlook (Messaging)
Program Description:
Created an Email Client in my application using Win32 API and MAPI. I'm able
to create and submit my message to Pocket Outlook, but the message resides in
the Outbox until the next synchronization (Send/Receive set @ 5 mins).
However, I need to send the email as soon as possible, and I've read about
COM objects such as IMailSyncCallBack, but I can't find any examples of how
to use this interface properly. A lot of the material that's on the Internet
is very limited, and it's hard to decipher. Maybe I'm confused on the concept
of custom transports (and honestly, I don't want to create one if I don't
have to), but isn't there a way to just use the default transport and
synchronize, without having to provide the implementation details for the
abstract class IMailSyncCallBack? Since MSDN states this as a COM interface,
this is what I've been trying to do, however to no avail:
Code:
CLSID clsid;
LPOLESTR pProgID = L"PocketOutlook.Application"; //Don't think this
is right..
hr = CLSIDFromProgID(pProgID, &clsid);
IMailSyncCallBack *pMSCB;
CoInitializeEx(NULL, COINIT_MULTITHREADED);
//Following Returns E_NOINTERFACE... Therefore, the CLSID is incorrect.
hr = CoCreateInstance(clsid, NULL, CLSCTX_INPROC_HANDLER,
IID_IMailSyncCallBack, (void**) pMSCB);
if(SUCCEEDED(hr))
{
//pMSCB Methods go here
pMSCB->Release();
}
else
{
//Error!
MessageBox(hWnd, _T("Instance Failed!"), _T("Warning!"), MB_OK);
CoUninitialize();
return(-1);
}
Any help would be greatly appreciated.
-kvh
Was this post helpful to you?
Why should I rate a post?
Expand AllCollapse All
Archived from group: microsoft>public>pocketpc>developer