IConverterSession::MIMEToMAPI

S

Scott McFadden

I used Microsoft's IConverterSession->MAPIToMIMEStm (exposed by Outlook
2003) to save an MSG into EML / RFC822 format.
I then turned around and tried to convert the eml file back to a MAPI MSG /
LPMESSAGE using the reverse call of IConverterSession->MIMEToMAPI.
When I invoke the MIMEtoMAPI call I get an Access Violation reading location
0.x00000000. Has anyone else had any luck using MAPIToMimeStrm?

Here is a code snippet of what I am doing:

hr = OpenStreamOnFile(MAPIAllocateBuffer, MAPIFreeBuffer, STGM_READ,
inMimeFile, NULL, &pMimeStream);

_ASSERTE(SUCCEEDED(hr));

hr=CoCreateInstance(CLSID_IConverterSession, NULL, CLSCTX_INPROC_SERVER,
IID_IConverterSession, (void **) &pConverterSession);

_ASSERTE(SUCCEEDED(hr));


pConverterSession->SetEncoding(IET_QP);

pConverterSession->SetSaveFormat(SAVE_RFC822);

hr = pConverterSession->MIMEToMAPI(pMimeStream, lpMessage , NULL, CCSF_SMTP
| CCSF_INCLUDE_BCC); <--access violation error ocurrs here

_ASSERTE(SUCCEEDED(hr));



scott
 
S

Sue Mosher [MVP-Outlook]

Better to post in microsoft.public.outlook.program_vba. This group is for end-user questions, not advanced programming issues.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
M

Milly Staples [MVP - Outlook]

If you post to an Outlook programming group, you will have a better shot at
someone reading your code and responding.

--
Milly Staples [MVP - Outlook]

Post all replies to the group to keep the discussion intact. All
unsolicited mail sent to my personal account will be deleted without
reading.


After furious head scratching, Scott McFadden asked:

| I used Microsoft's IConverterSession->MAPIToMIMEStm (exposed by
| Outlook 2003) to save an MSG into EML / RFC822 format.
| I then turned around and tried to convert the eml file back to a MAPI
| MSG / LPMESSAGE using the reverse call of
| IConverterSession->MIMEToMAPI.
| When I invoke the MIMEtoMAPI call I get an Access Violation reading
| location
| 0.x00000000. Has anyone else had any luck using MAPIToMimeStrm?
|
| Here is a code snippet of what I am doing:
|
| hr = OpenStreamOnFile(MAPIAllocateBuffer, MAPIFreeBuffer, STGM_READ,
| inMimeFile, NULL, &pMimeStream);
|
| _ASSERTE(SUCCEEDED(hr));
|
| hr=CoCreateInstance(CLSID_IConverterSession, NULL,
| CLSCTX_INPROC_SERVER, IID_IConverterSession, (void **)
| &pConverterSession);
|
| _ASSERTE(SUCCEEDED(hr));
|
|
| pConverterSession->SetEncoding(IET_QP);
|
| pConverterSession->SetSaveFormat(SAVE_RFC822);
|
| hr = pConverterSession->MIMEToMAPI(pMimeStream, lpMessage , NULL,
| CCSF_SMTP
|| CCSF_INCLUDE_BCC); <--access violation error ocurrs here
|
| _ASSERTE(SUCCEEDED(hr));
|
|
|
| scott
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top