Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Exception in GetContentsTable

0 views
Skip to first unread message

Victor

unread,
Nov 11, 2009, 3:24:01 AM11/11/09
to

Hello!

I have develop app to process messages from Outlook.

User select a folder in Outlook (using PickFolder method from Outlook OOM)
after that I convert it to IMAPIFolder to retrieve messages directly using
Extended MAPI. But I'm getting an exception (Unhandled Exc at 0x000000c0 in
... : 0xC000005: Access violation reading location 0x000000C0)

Here is the code snippet of that:

pFolder=pApp->GetNamespace(_bstr_t("MAPI"))->PickFolder();
if (pFolder==NULL) return 0;
ATLASSERT(pFolder);

LPMAPIFOLDER pMapiFolder = NULL;
HRESULT hr = pFolder->get_MAPIOBJECT((IUnknown**)&pMapiFolder);
ATLASSERT(pMapiFolder);

LPMAPITABLE m_pContents;
pMapiFolder->GetContentsTable(CMAPIEx::cm_nMAPICode,&m_pContents); //
here I'm getting an exception
(MAPI ogged on and intialized at another place. I
cutted it here)


Thank you.
Victor


Dmitry Streblechenko

unread,
Nov 11, 2009, 10:59:52 AM11/11/09
to
You get back IUnknown from the MAPIOBJECT property .You need to QI it for
IMAPIFolder Extended MAPI interface first

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"Victor" <Vic...@discussions.microsoft.com> wrote in message
news:56215035-9501-4ECE...@microsoft.com...

Victor

unread,
Nov 11, 2009, 2:20:02 PM11/11/09
to
Thank you Dmitry for the answer!
I have figured it using pFolder.GetPropertyByName( L"EntryID", &vEntryID );
and then opened that folder through Ex MAPI using m_pMsgStore->OpenEntry(...)

Currently I'm having another difficulty and your help will be very
appreciated.

When I read BodyFormat property of the message it returns 2 (html format).
BUT when I save it as MSG file it is saved as plain text. I want program to
retrieve body as plain text in that cases and not as HtmlBody.
How do I can differentiate it?

I think that message simply contained with both types (HTML and Plain text).
How do I can detect that message has both types then?

Thanks again, Dmitry!
victor

"Dmitry Streblechenko" wrote:

> .
>

Dmitry Streblechenko

unread,
Nov 12, 2009, 2:06:23 PM11/12/09
to
What do you see for PR_BODY / PR_HTML/ PR_RTF_COMPRESSED if you look at the
mesasge (click IMessage on the OUtlookSpy toolbar) and for teh MSG file
(click Misc | OpenIMsgOnIStg)?

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"Victor" <Vic...@discussions.microsoft.com> wrote in message

news:9F8760C8-18D8-4EEE...@microsoft.com...

0 new messages