Re: FOLLOWUP: RE: [JAWIN] IStorage

"Andre R. Santos" <[email protected]> Mon, 5 Jun 2006 14:36:40 -0400
Newsgroups gmane.comp.windows.devel.jawin
Message-ID <LISTSERV%[email protected]>
I'm using the techniques described at
http://jawinproject.sourceforge.net/jawin.html#callingDll and I'm getting an
error. This is what I've done so far:

Using Depency Walker, I found out that the function I want to call is
StgOpenStorage. This is the method signature:

WINOLEAPI StgOpenStorage(
  const WCHAR* pwcsName,
  IStorage* pstgPriority,
  DWORD grfMode,
  SNB snbExclude,
  DWORD reserved,
  IStorage** ppstgOpen
);

"IStorage** ppstg: [out] When the operation is successful, pointer to the
location of an IStorage pointer to the opened storage object. This parameter
is set to NULL if an error occurs."

What should I pass as a ppstgOpen parameter, and how I can use it later to
open an IStream Object?

Here's the code, which works fine, I just don't know what do to next:

            functionOpenStorage= new FuncPtr("ole32.dll", "StgOpenStorage");
            NakedByteStream nbs = new NakedByteStream();
            LittleEndianOutputStream leos = new LittleEndianOutputStream(nbs);

            leos.writeStringUnicode("D:\\Filename.QGD");
            leos.writeInt(0);
            leos.writeInt(0);
            leos.writeInt(0);
            leos.writeInt(0);

//what parameter should I pass here? (using 0 to test)
            leos.writeInt(0);

             functionOpenStorage.invoke("GIIIII::", 24, nbs, null,
ReturnFlags.CHECK_NONE);