Click here to Skip to main content
15,885,278 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: any way to detect, catch or provent crash from an invalid pointer? Pin
Luc Pattyn9-May-11 8:06
sitebuilderLuc Pattyn9-May-11 8:06 
GeneralRe: any way to detect, catch or provent crash from an invalid pointer? Pin
Richard MacCutchan9-May-11 9:23
mveRichard MacCutchan9-May-11 9:23 
GeneralRe: any way to detect, catch or provent crash from an invalid pointer? Pin
Luc Pattyn9-May-11 9:41
sitebuilderLuc Pattyn9-May-11 9:41 
GeneralRe: any way to detect, catch or provent crash from an invalid pointer? Pin
CPallini9-May-11 10:34
mveCPallini9-May-11 10:34 
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 
Hi
I have a problem with an MFC Project that opens an email template, and sets some user properties on the mail item. The code I have been given with is as follows:

SetProperties()
{
LPDISPATCH userProps;
outlookmailitem->InvokeHelper(0xf816, DISPATCH_PROPERTYGET, VT_DISPATCH, (void*)&userProps, NULL);
COleDispatchDriver* outlookUser = new COleDispatchDriver(userProps);

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, propertyName, 1); //falls here!
COleDispatchDriver* outlookUserProp = new COleDispatchDriver(userProp1);

static BYTE params2[] = VTS_VARIANT;
VARIANT va1;
va1.vt = VT_BSTR;
va1.bstrVal = emailMarking.AllocSysString();
outlookUserProp->InvokeHelper(0x0, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, params2, &va1);

delete(outlookUserProp);

Where I have added "//falls here!" is where it fails, and I think this is parameter issue, again. I cannot tell you what the error message I am getting because all that VS2010 is giving me is unhandled exception.

Looking at MSDN for VBA - http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook.userproperties.add.aspx#Y19 - it is final two parameters to me that Outlook is expecting, add to folders and display format. What I am trying to achieve is to ensure that the add to folder is set to false, and for the final one, I would like to set this to text if possible. How can set theses in MFC? What is the correct syntax? Do they need to set in this way or could Outlook set theses with the parameters being passed?

Thanks
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 
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 

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.