From: Scott McFadden on
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






From: Milly Staples [MVP - Outlook] on
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


From: Sue Mosher [MVP-Outlook] on
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
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Scott McFadden" <nospam.smcfadden(a)criticaltech.com> wrote in message news:uU42Xi5TGHA.4792(a)TK2MSFTNGP14.phx.gbl...
>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
>
>
>
>
>
>
 | 
Pages: 1
Prev: OUTLOOK2003
Next: Outlook 2002 calendar holidays