Random Post: WordPress
RSS .92| RSS 2.0| ATOM 0.3
  • Home
  • About
  • Eric’s Toolset
  • Free Software
  • Software License
  •  

    Getting an IStream on a File

    April 28th, 2007 by Eric

    Getting a COM IStream instance on a normal file seems like something that should be trivial to do, but it always seems to take some hunting to remember how it is actually done.

    There is a function in the shell API that will return an IStream on a file: SHCreateStreamOnFile. It is in version 5 or later of the shell, which is the version that shipped with Windows 2000, but comes along with IE 5 or later for older operating systems.

    I’ve also heard people suggest that there is a similar function in the Extended MAPI library, but using the shell seems generally more palatable.

    Leave a Reply