GetAllSource returns S_OK but buffer is empty

10 views
Skip to first unread message

rkrato

unread,
Oct 2, 2009, 4:06:47 PM10/2/09
to Nektra OEAPI Support
Using GetAllSource to save a message as an .eml file. Seems to work
fine with OE on XP but on Vista with WinMail it is returning S_OK but
buffer is empty.

OEAPI v3.2.1

Rod

Nektra OEAPI Support

unread,
Oct 8, 2009, 10:01:40 AM10/8/09
to nektra...@googlegroups.com
Hi Rod,

We have tested the GetAllSource method to save that string to a file
with correct results on Vista using versions 3.2.1 and current 3.2.3.
Are you using a DLL or an EXE plugin?
Which programming language and IDE version is being used?
Does this happen with any messages or with some in particular?
Could you send a code snippet to know how are you trying this?

Thank you for contacting Nektra's OEAPI Support.

Regards,

Federico
--
Nektra Advanced Computing
http://www.nektra.com

rkrato

unread,
Oct 12, 2009, 11:00:30 AM10/12/09
to Nektra OEAPI Support
This is a dll plugin.

Written in C++ using Visual Studio 2005.

I will have to run some tests to see if it is related to a particular
message or messages.

CComPtr<OESTORE::IOEMessage> m_spIOEMsg;

HRESULT CSBOEPlugIn::OnCurrentMessageChanged(long nMsgId)
{
HRESULT hr = S_OK;
if (m_pIEScanner && nMsgId != -1)
{
CComPtr<OESTORE::IOEFolder> spIFolder;
long nFolderId = 0;
hr = m_spIOEApi->GetSelectedFolderID(&nFolderId );
if (SUCCEEDED(hr))
{
if (m_spIFolderMgr != NULL)
hr = m_spIFolderMgr->GetFolder(nFolderId , &spIFolder);
if (SUCCEEDED(hr) && (spIFolder != NULL))
{
COEMailItem emailItem(spIFolder, nMsgId);
m_pIEScanner->ScanNow(&emailItem);
}
}

}
return hr;
}

COEMailItem::COEMailItem(OESTORE::IOEFolder *pIFolder, long nMsgId)
{
if (NULL != pIFolder)
{
HRESULT hr = pIFolder->OEGetMessage(nMsgId, &m_spIOEMsg);
if (FAILED(hr))
{
m_spIOEMsg = NULL;
CAtlString sMsg;
sMsg.Format(L"Get Message failed. 0x%x", hr);
SBLOG(SBLogger_LogLevelError, __WFUNCTION__, sMsg);
}

}
}

CComBSTR COEMailItem::GetMessageSource()
{
CComBSTR bstrVal;
if (m_spIOEMsg)
{
HRESULT hr = m_spIOEMsg->GetAllSource(&bstrVal);
if (FAILED(hr))
{
bstrVal.Empty();
CAtlString sMsg;
sMsg.Format(L"GetAllSource Failed. 0x%x", hr);
SBLOG(SBLogger_LogLevelError, __WFUNCTION__, sMsg);
}
else
{
CAtlString sMsg;
sMsg.Format(L"GetMessageSource. (%s)", bstrVal);
SBLOG(SBLogger_LogLevelTrace, __WFUNCTION__, sMsg);

if(!bstrVal.Length())
{
// it's EMPTY! try getting just the text body
bstrVal = GetTextBody();
sMsg.Format(L"GetMessageSource was empty trying to use the
TextBody instead. (%s)", bstrVal);
SBLOG(SBLogger_LogLevelTrace, __WFUNCTION__, sMsg);
}
}
}
return bstrVal;
}

On Oct 8, 10:01 am, Nektra OEAPI Support <oeapi-supp...@nektra.com>
wrote:
Reply all
Reply to author
Forward
0 new messages