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

MAPI Session timeout

0 views
Skip to first unread message

Roger

unread,
Feb 12, 2004, 6:26:06 PM2/12/04
to
I have a pst file (1.5GB in size). There are over 1700 messages with very large attachement.

I need to extrac each messages to files. I am using CDO, redemption to get those messages out.

However, when the applicaiton processes messages till 1200+. My application responses "MAPI session time out". How to hold the Mapi sesssion? I am using CDO to create MAPI.session.

I need to process large .pst files and contains thousands of messages. Any possibility?


Dmitry Streblechenko (MVP)

unread,
Feb 13, 2004, 3:16:21 AM2/13/04
to
Which method returns the timeout error?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


"Roger" <anon...@discussions.microsoft.com> wrote in message
news:C1FE528D-F966-4B38...@microsoft.com...

Roger

unread,
Feb 13, 2004, 11:11:09 AM2/13/04
to
I dumped the error mesage.

Failed to add MAPI message [Collaboration Data Objects - [E_OUTOFMEMORY(8007000E)]]


Here is what I did.

MAPILogonEx() to logon session in a service
Get Inbox Folder ptr using CDO
Start to process folders in Inbox
( Use Redemption to get each message and then create RFC822 files)

The applicaiton always stops when it processes to message 1100 - 1200.

Any clue?

Roger

unread,
Feb 13, 2004, 12:21:08 PM2/13/04
to

I think 'sItem->put_Item' is the place casued error. (Failed to add MAPI message [Collaboration Data Objects - [E_OUTOFMEMORY(8007000E)]])

the program stops when it processes Mesasge No 1200+.


Redemption::ISafeMailItemPtr sItem;
hr = m_SafeMailItemFactory->CreateInstance(NULL, __uuidof(Redemption::ISafeMailItem), (void**)&sItem);

for (int i=1; i<= MsgCount; i++)
{
CurrentMsg = msgs->GetNext();

hr = sItem->put_Item(CurrentMsg);
hr = sItem->raw_SaveAs(_bstr_t(MsgFile), _variant_t((long)Redemption::olRFC822));

}

Dmitry Streblechenko (MVP)

unread,
Feb 13, 2004, 3:37:15 PM2/13/04
to
Hmmm... Redemption does not return any "Collaboration Data Objects" errors.
Are you sure it is 'sItem->put_Item' line? It could also be msgs->GetNext
line. Are you using straight VC++ or .Net?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


"Roger" <anon...@discussions.microsoft.com> wrote in message

news:50D73B28-4BB4-4237...@microsoft.com...

Roger

unread,
Feb 13, 2004, 8:06:08 PM2/13/04
to
I am using C++.

I will have more test on it this weekend.

Also, if the error is really caused by GetNext(), will it be possible to use Redemption?

Here is an example of my current pst file.

- Inbox (728 message)
- test1 (488 messages)
- test2 (720 mesages) --> My application will fail here.

Actually, my application can't process the message over 1650. It fails at the message each time.

Dmitry Streblechenko (MVP)

unread,
Feb 16, 2004, 4:18:52 PM2/16/04
to
How do you declare CurrentMsg? Do you release it *inside* of the for loop?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


"Roger" <anon...@discussions.microsoft.com> wrote in message

news:60415E0A-1F3C-424E...@microsoft.com...

Doru K

unread,
Feb 27, 2004, 10:02:46 PM2/27/04
to

Hi, I'm new around here, and specially around Redemption, but I quickly
got to realize it's a great tool. I only have one question (for now :) -
I'm developing in Visual C++, and I'm trying to replace my old security
affected code, with the 'safe' code.

So, here is my old code:

//this is the code I want to replace:

CComPtr<Outlook::_NameSpace> spNS;
HRESULT hr = m_spApp->GetNamespace(T2W("MAPI"), &spNS);
CComPtr<Outlook::MAPIFolder> spContacts;
hr = spNS->GetDefaultFolder(olFolderContacts, &spContacts);
if(FAILED(hr))
return false;
CComPtr<Outlook::_Items> spItms;
hr = spContacts->get_Items(&spItms);
if(FAILED(hr))
return false;

CComPtr<IDispatch> spFirstItem;
hr = spItms->GetFirst(&spFirstItem);
if(FAILED(hr))
return false;
CString strTmp;
while(spFirstItem != NULL) //there are still addresses here
{
CComQIPtr<Outlook::_ContactItem> spFirstContactItem(spFirstItem);
//HOW DO I DO THIS IN THE CODE USING REDEMPTION???
BSTR emailAddress;
hr = spFirstContactItem->get_Email1Address(&emailAddress);
if(FAILED(hr))
return false;
strTmp = W2T(emailAddress);
if(!strTmp.IsEmpty())
m_saWhiteList.Add(strTmp);

spFirstItem.Release();
bFirstLoop = false;
hr = spItms->GetNext(&spFirstItem);
if(FAILED(hr))
break;
}


Now, I thought that I could use this instead:
...bla-bla
CComPtr<IDispatch> spFirstItem;
hr = spItms->GetFirst(&spFirstItem);
if(FAILED(hr))
return false;

ISafeContactItemPtr pSafeContact;
CLSID clsid;

if ((hr = ::CLSIDFromProgID(L"Redemption.SafeContactItem", &clsid)) !=
NOERROR)
{
return false;
}

if ((hr = ::CoCreateInstance(clsid, NULL, CLSCTX_INPROC_SERVER,
__uuidof(ISafeContactItem),
(void**)&pSafeContact)) != S_OK)
{
return false;
}

//HERE IS THE PROBLEM: How do I bound the info I have in spFirstItem, to
pSafeContact. In the old code, I only had to do this:
CComQIPtr<Outlook::_ContactItem> spFirstContactItem(spFirstItem);

CString strTmp;
if(pSafeContact != NULL)
{
BSTR emailAddress;
hr = pSafeContact->get_Email1Address(&emailAddress);
if(FAILED(hr))
return false;
strTmp = W2T(emailAddress);
bla-bla...
}

I hope I wasn't to complicated :) Actually, all I want to know is how do
I bound spFirstItem to pSafeContact. Thank you!

Doru K.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Dmitry Streblechenko (MVP)

unread,
Mar 1, 2004, 12:51:01 PM3/1/04
to
You need to set the SafeContactItem.Item property to the original OOM
object:

pSafeContact->put_Item(spFirstContactItem);


Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


"Doru K" <blue...@fake.com> wrote in message
news:eDCdYda$DHA....@TK2MSFTNGP09.phx.gbl...

0 new messages