From: Jeff on
I am trying to use the existing mailtrns.dll to synchronize programatically
using evc 4 and Windows Mobile 2003 SE.

I get the ONESTOPFACTORYFUNC and can call the IMAILSYNCHANDLER without a
problem. I cannot seem to get my callback to work. The callback calls the
correct methods within the class that I create but throws an exception
"Datatype Mismatch" on return. If I omit the Addref method from my call it
calls Progess and I can see that the incoming parameters are also incorrect.
I assume that the way I create this class therefore is incorrect.

My callback class looks something like this (just the first few lines
included for brevity)

public:
CMailSyncCallBack();
~CMailSyncCallBack();

HRESULT STDMETHODCALLTYPE QueryInterface (REFIID rif, LPVOID* ppobj);
ULONG STDMETHODCALLTYPE AddRef();
ULONG STDMETHODCALLTYPE Release();


MAPIMETHOD(RequestSync)(
LPCWSTR pszProfile,
DWORD cbCookie,
LPBYTE pbCookie
) ;


etc....

I instantiate the class and then call initialize like this:

CMailSyncCallBack *ms = new CMailSyncCallBack();

hr = pIMailSyncHandler->Initialize((IMailSyncCallBack *)ms,
_T("POP3"),pMsgStore);


Should I be doing this some other way as clearly the parametes are not being
passed correctly.

Jeff
 | 
Pages: 1
Prev: Target Platform
Next: Recording Speech