Click here to Skip to main content
15,880,725 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Problem Opening Email when using InvokeHelper in C++ Pin
barneyman7-May-11 15:23
barneyman7-May-11 15:23 
GeneralRe: Problem Opening Email when using InvokeHelper in C++ Pin
Member 29729928-May-11 6:12
Member 29729928-May-11 6:12 
GeneralRe: Problem Opening Email when using InvokeHelper in C++ Pin
barneyman8-May-11 13:04
barneyman8-May-11 13:04 
GeneralRe: Problem Opening Email when using InvokeHelper in C++ Pin
Member 29729928-May-11 22:27
Member 29729928-May-11 22:27 
GeneralRe: Problem Opening Email when using InvokeHelper in C++ Pin
barneyman8-May-11 22:37
barneyman8-May-11 22:37 
GeneralRe: Problem Opening Email when using InvokeHelper in C++ Pin
Member 29729928-May-11 22:50
Member 29729928-May-11 22:50 
GeneralRe: Problem Opening Email when using InvokeHelper in C++ Pin
Member 29729928-May-11 23:11
Member 29729928-May-11 23:11 
AnswerRe: Problem Opening Email when using InvokeHelper in C++ Pin
Roger Broomfield9-May-11 1:37
Roger Broomfield9-May-11 1:37 
I believe your problem is with the last parameter to "CreateItemFromTemplate". NULL is not the correct way to pass an [in, optional] VARIANT. There is no need to convert filePath to a BSTR, presuming that "outlookApp" is indeed an COleDispatchDriver. Do cast it to an LPCTSTR, InvokeHelper expects an in param defined as a VTS_BSTR to be an LPCTSTR, MFC's implementation of COleDispathDrvier will do the BSTR conversion for you inside the InvokeHelper call.

OpenOutlookNewMessageWithMsgFile(CString filePath)
{
    COleVariant varOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR);
    LPDISPATCH mailItem;
    static BYTE params [] = VTS_BSTR VTS_VARIANT ;
 
    outlookApp->InvokeHelper(0x10b, DISPATCH_METHOD, VT_DISPATCH, (void*)&mailItem, params, (LPCTSTR)filePath, &varOptional);

GeneralRe: Problem Opening Email when using InvokeHelper in C++ Pin
Member 29729929-May-11 2:04
Member 29729929-May-11 2:04 
GeneralRe: Problem Opening Email when using InvokeHelper in C++ Pin
Member 29729929-May-11 2:25
Member 29729929-May-11 2:25 
QuestionWant logic or code for this in c Pin
KIDYA6-May-11 4:08
KIDYA6-May-11 4:08 
AnswerRe: Want logic or code for this in c Pin
CodyDaemon6-May-11 4:18
CodyDaemon6-May-11 4:18 
GeneralRe: Want logic or code for this in c Pin
KIDYA6-May-11 4:30
KIDYA6-May-11 4:30 
AnswerRe: Want logic or code for this in c Pin
Luc Pattyn6-May-11 4:30
sitebuilderLuc Pattyn6-May-11 4:30 
GeneralRe: Want logic or code for this in c Pin
CPallini6-May-11 10:17
mveCPallini6-May-11 10:17 
GeneralRe: Want logic or code for this in c Pin
Luc Pattyn6-May-11 15:30
sitebuilderLuc Pattyn6-May-11 15:30 
QuestionEncrypting the existing file and folder Pin
sarfaraznawaz6-May-11 1:22
sarfaraznawaz6-May-11 1:22 
AnswerRe: Encrypting the existing file and folder Pin
ShilpiP6-May-11 1:42
ShilpiP6-May-11 1:42 
AnswerRe: Encrypting the existing file and folder Pin
Richard MacCutchan6-May-11 3:05
mveRichard MacCutchan6-May-11 3:05 
GeneralRe: Encrypting the existing file and folder Pin
sarfaraznawaz11-May-11 22:49
sarfaraznawaz11-May-11 22:49 
GeneralRe: Encrypting the existing file and folder Pin
Richard MacCutchan11-May-11 23:22
mveRichard MacCutchan11-May-11 23:22 
Questionhow to assign unsigned char in c++? Pin
mathivanaan6-May-11 1:00
mathivanaan6-May-11 1:00 
AnswerRe: how to assign unsigned char in c++? Pin
Chris Losinger6-May-11 1:01
professionalChris Losinger6-May-11 1:01 
QuestionRe: how to assign unsigned char in c++? Pin
Niklas L6-May-11 1:18
Niklas L6-May-11 1:18 
AnswerRe: how to assign unsigned char in c++? Pin
CPallini6-May-11 10:18
mveCPallini6-May-11 10:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.