M
msoliver
I'm writing a simple C++/ATL program that is interacting w/ the
Outlook object model. There seems to be some odd change to
Application.CreateItem for Outlook 2007. Here are my simple lines of
code:
Outlook::_ApplicationPtr spApplication;
Outlook::_MailItemPtr spMailItem;
HRESULT hr =
spApplication.CreateInstance(__uuidof(Outlook::Application));
if (FAILED(hr))
return;
spMailItem = spApplication->CreateItem(Outlook:lMailItem);
spMailItem is NULL after this code executes. Stepping into CreateItem,
I see that it is returning a IDispatch*, but then when the
QueryInterface occurs for the _MailItem* interface, the COM error code
is: E_NOINTERFACE.
This seems to be the case for all of the different types of Outlook
items, not just mail items.
What changed? What object is being returned by CreateItem? I've looked
all over the net and MSDN and found no info - am stumped.
Outlook object model. There seems to be some odd change to
Application.CreateItem for Outlook 2007. Here are my simple lines of
code:
Outlook::_ApplicationPtr spApplication;
Outlook::_MailItemPtr spMailItem;
HRESULT hr =
spApplication.CreateInstance(__uuidof(Outlook::Application));
if (FAILED(hr))
return;
spMailItem = spApplication->CreateItem(Outlook:lMailItem);
spMailItem is NULL after this code executes. Stepping into CreateItem,
I see that it is returning a IDispatch*, but then when the
QueryInterface occurs for the _MailItem* interface, the COM error code
is: E_NOINTERFACE.
This seems to be the case for all of the different types of Outlook
items, not just mail items.
What changed? What object is being returned by CreateItem? I've looked
all over the net and MSDN and found no info - am stumped.