[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::blush:lAppointmentItem, &pDisp);
//pDisp = olapp->CreateItem(Outlook::blush: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.....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top