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

GetRecipientTable() Run-Time Check Failure #0 error

0 views
Skip to first unread message

asno...@gmail.com

unread,
Oct 23, 2009, 1:31:22 AM10/23/09
to
IMAPITable *pTable;
spMessage->GetRecipientTable(0, &pTable);
Above call gives "Run-Time Check Failure #0 - The value of ESP was not
properly saved across a function call."

This is being called from COM out-proc server. Here is call sequence.

CoInitialize(NULL);
MAPIINIT_0 pMapiInit = { MAPI_INIT_VERSION, MAPI_NT_SERVICE |
MAPI_MULTITHREAD_NOTIFICATIONS };

MAPIInitialize(&pMapiInit);

MsgStorePtr spMapiStore;
hr = spSession->OpenEntry(); //This works fine

IMessagePtr spMapiMsg;
hr = spMapiStore->OpenEntry() ; //This works fine, I get valid
entryID.

IMAPITable *pTable;
spMessage->GetRecipientTable(0, &pTable); //Run-Time Check Failure
#0

Interesting things are
1) This code has been working in VC6.0. We are having this issue in
VS2008
2) This problem does not happens on random machines.

I think this error is related to Marshalling and given caller is in
STA, could MAPI be set to MTA?
Can I change the partment model of MAPI in any way? I use MapiDefs.h,
comes with MSSDK-6.0A
I have no clue why this is happening, please let me know if you see
anything wrong.

Thanks
Ramesh

0 new messages