E
Ertan EFE
hi everyone,
I m new to outlook programming. ý m developing a outlook add-in. in the add
in ý want to do some tasks.
I want to access e-mail body and get it. when ý call the get_Body method on
actual _MailItem object it gives me a access violation error message.
code is here
HRESULT hr;
CComPtr<Outlook::MAPIFolder> spMapiFolder;
m_spExplorer->get_CurrentFolder(&spMapiFolder);
CComPtr<Outlook::_Items> spOutlookItems;
spMapiFolder->get_Items(&spOutlookItems);
CComPtr<Outlook::_MailItem> spMailItem;
hr = spOutlookItems->GetFirst((IDispatch**)&spMailItem);
CComBSTR spMessageBody;
spMailItem->get_Body(&spMessageBody)
OutputDebugString("ok....")
the program couldn't passed the spMailItem->get_Body(&spMessageBody) code
line when the the line of code executed an access violation error occured.
then ý tryed with reading some basic property of the MailItem witout passig
a bstr pointer. for example get mesaagee read status.
corresponding code is here
VARIANT_BOOL l_bIsUnread(TRUE);
hr = spMailItem->get_UnRead(&l_bIsUnread);
the program couldn't passed the hr = spMailItem->get_UnRead(&l_bIsUnread);
code line. it gives me an error message.
"Run-Time Check Failure #0 - The value of ESP was not properly saved across
a function call. This is usually a result of calling a function declared
with one calling convention with a function pointer declared with a
different calling convention."
does anyone know what is my wrong think ?
many thanks to any advise
I m new to outlook programming. ý m developing a outlook add-in. in the add
in ý want to do some tasks.
I want to access e-mail body and get it. when ý call the get_Body method on
actual _MailItem object it gives me a access violation error message.
code is here
HRESULT hr;
CComPtr<Outlook::MAPIFolder> spMapiFolder;
m_spExplorer->get_CurrentFolder(&spMapiFolder);
CComPtr<Outlook::_Items> spOutlookItems;
spMapiFolder->get_Items(&spOutlookItems);
CComPtr<Outlook::_MailItem> spMailItem;
hr = spOutlookItems->GetFirst((IDispatch**)&spMailItem);
CComBSTR spMessageBody;
spMailItem->get_Body(&spMessageBody)
OutputDebugString("ok....")
the program couldn't passed the spMailItem->get_Body(&spMessageBody) code
line when the the line of code executed an access violation error occured.
then ý tryed with reading some basic property of the MailItem witout passig
a bstr pointer. for example get mesaagee read status.
corresponding code is here
VARIANT_BOOL l_bIsUnread(TRUE);
hr = spMailItem->get_UnRead(&l_bIsUnread);
the program couldn't passed the hr = spMailItem->get_UnRead(&l_bIsUnread);
code line. it gives me an error message.
"Run-Time Check Failure #0 - The value of ESP was not properly saved across
a function call. This is usually a result of calling a function declared
with one calling convention with a function pointer declared with a
different calling convention."
does anyone know what is my wrong think ?
many thanks to any advise