[C++] error on CreateItem

C

cyan21

hello,

I have some problems when I want to create an item ( email, appointment
).
the IDisptach pointer returned is null, how can I fix this ?

yann.


hr = olapp.CoCreateInstance(__uuidof(Outlook::Application), NULL,
CLSCTX_SERVER);
SUCCEEDED(hr);

hr = olapp->raw_CreateItem(Outlook::eek:lAppointmentItem, &pDisp);
//pDisp = olapp->CreateItem(Outlook::eek:lAppointmentItem);
SUCCEEDED(hr);

ATLASSERT(pDisp); /// ERROR
appt = pDisp;
 
C

cyan21

the error mentions pDisp was null after CreateItem.....

I found out a another error occured before CreateItem, I fixed it,
stopped and then restarted Outlook........It worked fine.

It's weird.....
 
Top