WrapCompressedRTFStream() produces bad data

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I wish someone can help me!!!!

WrapCompressedRTFStream() is returning S_OK but it is returning
corrupt data. Buffer returned by this API does have any RTF headers
and looks like a BINARY blob.

I am extracting PR_RTF_COMPRESSED stream from a TNEF file by parsing
the winmail.dat. This means I do not have any MAPI code except for
MAPIInitialize(). I thought my PR_RTF_COMPRESSED is corrupt, so I
opened winmail.dat using MfcMapi.exe; and i saw that PR_RTF_COMPRESSED
shown there is exactly with the stream what I am feeding to
WrapCompressedRTFStream(). I opened the winmail.dat in binary editor
and I was able to LZFU, compressed-rtf signature.
Even Winmail.exe, a TNEF viewer, is able to display the message body
contained in the winmail.dat.
So the stream is correct but I must be doing something wrong, please
help me.

I think following might be causing some problem
1) I might not have initiliazed MAPI properly. Currently I have just
called MAPIInitialize().
2) The IStream that is being passed to WrapCompressedRTFStream() is
created using CreateStreamOnHGlobal();
and the stream returned by this API might have some limitations.

Please help me figure this out...

TIA
Ramesh

.



Relevant Pages

  • WrapCompressedRTFStream() produces bad data
    ... WrapCompressedRTFStream() is returning S_OK but it is returning ... corrupt data. ... I am extracting PR_RTF_COMPRESSED stream from a TNEF file by parsing ... and the stream returned by this API might have some limitations. ...
    (microsoft.public.win32.programmer.messaging)
  • Re: WrapCompressedRTFStream() produces bad data
    ... OutlookSpy - Outlook, CDO ... and MAPI Developer Tool ... WrapCompressedRTFStream() is returning S_OK but it is returning ... I am extracting PR_RTF_COMPRESSED stream from a TNEF file by parsing ...
    (microsoft.public.win32.programmer.messaging)
  • Re: WrapCompressedRTFStream() produces bad data
    ... Once for testing, to WrapCompressedRTFStream(), I fed an IStream ... and MAPI Developer Tool ... So the stream is correct but I must be doing something wrong, ...
    (microsoft.public.win32.programmer.messaging)
  • Re: TaskItem and AppointmentItem formated body
    ... OpenPropertyto get the compressed stream ... WrapCompressedRTFStream() to get an uncompressed stream out ... then use standard IStream operations on that stream, ...
    (microsoft.public.outlook.program_vba)