Go4Expert

Go4Expert (http://www.go4expert.com/)
-   MFC (http://www.go4expert.com/forums/mfc/)
-   -   Problem Opening Email when using InvokeHelper in C++ (http://www.go4expert.com/forums/email-using-invokehelper-cpp-t25725/)

andynewtoC++ 7May2011 01:55

Problem Opening Email when using InvokeHelper in C++
 
Hi

I have an MFC Project, and what this project does is to allow a user to Open an in a number of different way, either a new email message, a new email message using a template or open an existing email message. The MFC is part of a much larger application and some of the data for selecting the correct email templates and opening an existing email comes from a web service.

My MFC Project works to a certain, I can get Outlook, I can get my Web Service with my email template, but when I reach the point of Open the Email either a new one, open or otherwise it fails. Here is my code snippet:

CString emailPath;
LPDISPATCH mailItem;
static BYTE params [] = VIS_BSTR VTS_VARIANT ;

m_outlook->(0x10a, DISPATCH_METHOD, VT_DISPATCH, (void*)&mailItem, params, emailPath, NULL) //falls over here!

outlookMailItem = new COleDispatchDriver(mailItem);

What I have done wrong?

Thanks


All times are GMT +5.5. The time now is 18:42.