R
R2FicmllbA
Hello,
I am still brand new to ATL/COM add-in development so I assume there is an
obvious answer to this. I'm using VC++ 6 and the add-in is for Outlook 2003.
I am attempting to add the body of the currently selected message to a new
message I create. The new message creation/sending part works fine, but I get
a fatal error every time I use the get_CurrentItem() method. Here's the
relevant code (I got almost all of this from tutorials):
CComPtr <Outlook::_MailItem> mailPtr;
m_spApp->CreateItem(Outlook:lMailItem, (IDispatch**)&mailPtr);
CComPtr<Outlook::_Inspector> spInspector;
hr = m_spApp->ActiveInspector(&spInspector);
if (FAILED(hr)){
MessageBox(NULL,"Error retrieving inspector","Inspector",MB_OK);
return;
}
CComPtr<IDispatch> spCurrentItem;
CComPtr<Outlook::_MailItem> mailPtr2;
spInspector->get_CurrentItem(&spCurrentItem);
Any input is greatly appreciated. Let me know if you need any more info.
I am still brand new to ATL/COM add-in development so I assume there is an
obvious answer to this. I'm using VC++ 6 and the add-in is for Outlook 2003.
I am attempting to add the body of the currently selected message to a new
message I create. The new message creation/sending part works fine, but I get
a fatal error every time I use the get_CurrentItem() method. Here's the
relevant code (I got almost all of this from tutorials):
CComPtr <Outlook::_MailItem> mailPtr;
m_spApp->CreateItem(Outlook:lMailItem, (IDispatch**)&mailPtr);
CComPtr<Outlook::_Inspector> spInspector;
hr = m_spApp->ActiveInspector(&spInspector);
if (FAILED(hr)){
MessageBox(NULL,"Error retrieving inspector","Inspector",MB_OK);
return;
}
CComPtr<IDispatch> spCurrentItem;
CComPtr<Outlook::_MailItem> mailPtr2;
spInspector->get_CurrentItem(&spCurrentItem);
Any input is greatly appreciated. Let me know if you need any more info.