Click here to Skip to main content
15,891,136 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: any way to detect, catch or provent crash from an invalid pointer? Pin
Luc Pattyn9-May-11 11:17
sitebuilderLuc Pattyn9-May-11 11:17 
AnswerRe: any way to detect, catch or provent crash from an invalid pointer? Pin
jschell9-May-11 9:29
jschell9-May-11 9:29 
AnswerRe: any way to detect, catch or provent crash from an invalid pointer? Pin
varunpandeyengg9-May-11 22:47
varunpandeyengg9-May-11 22:47 
QuestionHow correctly set User Properties to MS Outlook Mail Item in MFC Pin
Member 29729929-May-11 5:19
Member 29729929-May-11 5:19 
AnswerRe: How correctly set User Properties to MS Outlook Mail Item in MFC Pin
David Crow9-May-11 6:00
David Crow9-May-11 6:00 
GeneralRe: How correctly set User Properties to MS Outlook Mail Item in MFC Pin
Member 29729929-May-11 6:16
Member 29729929-May-11 6:16 
GeneralRe: How correctly set User Properties to MS Outlook Mail Item in MFC Pin
David Crow9-May-11 6:26
David Crow9-May-11 6:26 
AnswerRe: How correctly set User Properties to MS Outlook Mail Item in MFC Pin
Roger Broomfield9-May-11 7:11
Roger Broomfield9-May-11 7:11 
I would hazard a guess from the code that its the same issue you had before, regarding the passing of [in, optional] VARIANT parameters. Everytime you come across an [in, optional] VARIANT parameter, what you have to pass is the address of a VARAIANT that contains type VT_ERROR, and value DISP_E_PARAMNOTFOUND. In this case, from the static BYTE params[] declaration there are two "optional" parameters.
COleVariant varOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR);
LPDISPATCH userProp1;
static BYTE params[] = VTS_BSTR VTS_I4 VTS_VARIANT VTS_VARIANT;
CString propertyName = _T("Email Marking");
outlookUser->InvokeHelper(0x66, DISPATCH_METHOD, VT_DISPATCH, (void*)&userProp1, params, (LPCTSTR)propertyName, 1, &varOptional, &varOptional);

Notes:
I have not looked up what dispatch method 0x66 is so I am not 100% sure.
The presence of a VTS_VARIANT in the params array does not always mean optional, however an optional parameter is always a variant.
The VTS_BSTR in the params array of an InvokeHelper call is expected to be an LPCTSTR. to allow the CString to pass the correct value always type cast it to (LPCTSTR). The type casting is neccessary because InvokeHelper is declared as void AFX_CDECL InvokeHelper(DISPID dwDispID, WORD wFlags, VARTYPE vtRet, void* pvRet, const BYTE* pbParamInfo, ...); so the compiler doesnt know specifically what to pass. By type casting it you ensure the correct value is passed.
GeneralRe: How correctly set User Properties to MS Outlook Mail Item in MFC Pin
Member 297299210-May-11 12:09
Member 297299210-May-11 12:09 
GeneralRe: How correctly set User Properties to MS Outlook Mail Item in MFC Pin
Roger Broomfield10-May-11 15:47
Roger Broomfield10-May-11 15:47 
Questionwhich book should read? Pin
baojianbing9-May-11 4:42
baojianbing9-May-11 4:42 
AnswerRe: which book should read? Pin
Maximilien9-May-11 4:53
Maximilien9-May-11 4:53 
GeneralRe: which book should read? Pin
baojianbing9-May-11 14:32
baojianbing9-May-11 14:32 
AnswerRe: which book should read? Pin
Dalek Dave19-May-11 13:17
professionalDalek Dave19-May-11 13:17 
QuestionGet amount of free memory Pin
jung-kreidler9-May-11 4:24
jung-kreidler9-May-11 4:24 
AnswerRe: Get amount of free memory Pin
David Crow9-May-11 5:53
David Crow9-May-11 5:53 
GeneralRe: Get amount of free memory Pin
jung-kreidler9-May-11 22:30
jung-kreidler9-May-11 22:30 
GeneralRe: Get amount of free memory Pin
David Crow10-May-11 2:20
David Crow10-May-11 2:20 
GeneralRe: Get amount of free memory Pin
jung-kreidler10-May-11 20:37
jung-kreidler10-May-11 20:37 
AnswerRe: Get amount of free memory Pin
Luc Pattyn9-May-11 6:28
sitebuilderLuc Pattyn9-May-11 6:28 
GeneralRe: Get amount of free memory Pin
jung-kreidler9-May-11 20:00
jung-kreidler9-May-11 20:00 
QuestionMissing COM dll for IE 08 Toolbar Development Pin
varunpandeyengg9-May-11 0:41
varunpandeyengg9-May-11 0:41 
AnswerRe: Missing COM dll for IE 08 Toolbar Development Pin
Hans Dietrich9-May-11 1:01
mentorHans Dietrich9-May-11 1:01 
GeneralRe: Missing COM dll for IE 08 Toolbar Development Pin
varunpandeyengg9-May-11 1:25
varunpandeyengg9-May-11 1:25 
AnswerRe: Missing COM dll for IE 08 Toolbar Development Pin
Hans Dietrich9-May-11 2:39
mentorHans Dietrich9-May-11 2:39 

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.