Copy an IStorage interface to an IStream interface for ATTACH_OLE attachments



How do I copy an IStorage interface to an IStream interface?
Attachments of type ATTACH_OLE seem to require an IID_IStorage
interface.

case ATTACH_OLE:
{
LPSTORAGE pSource = NULL;
LPSTREAM pDest = NULL;
STATSTG StatInfo = {0};

hr = pAttach->OpenProperty(PR_ATTACH_DATA_OBJ,(LPIID)&IID_IStorage,0,0,(LPUNKNOWN *)&pSource);
hr = pSource->Stat(&StatInfo, STATFLAG_NONAME);

/* Copy pSource to pDest somehow, thanks forum members! */

/* Now I can read the content to file or my own buffer etc... */
hr = pStream->Read(lpBuffer, ulBufferSize, &ulRead);

}


.



Relevant Pages

  • Re: Finding the real attachment in a signed message
    ... attachments, those attachments are saved (if the message is *not* digitally ... OutlookSpy - Outlook, CDO ... and MAPI Developer Tool ... interface and find the true attachment. ...
    (microsoft.public.win32.programmer.messaging)
  • Re: xMAPI save attachment to disk
    ... I am assuming that by the inbox you mean the default delivery folder ... Call HrQueryAllRows against that table interface to get all of the entries. ... Using this entry ID call IMAPISession::OpenMsgStore to get an IMsgStore ... Call HrQueryAllRows on this table to get the attachments ...
    (microsoft.public.win32.programmer.messaging)
  • Attachments and standalone .msg files
    ... Are there supposed to be any problems accessing attachments using IMessage ... Call 'StgOpenStorage' to get IStorage interface for .msg file ...
    (microsoft.public.win32.programmer.messaging)
  • Re: [opensuse] Have a separate resolv.conf per interface
    ... interface would be on 2 separate networks with each interface having a ... The contents of this e-mail message and any attachments are intended solely for ... This communication is intended to be and to ...
    (SuSE)
  • about fax
    ... I would like to provide an interface to send fax, as well as pdf ... attachments, inside my asp.net web. ... Regards, ...
    (microsoft.public.dotnet.framework.aspnet)

Loading