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