Hello Folks
I need some help - I guess I'm missing some very fundamental point
somewhere. I am attempting to write some simple data structures as a Stream
in the Root storage of a new "docfile" - my first attempt at utilizing
structured storage files. I, uh, well, can't get the "write to file"
function to compile. In that function, I have declared the Storage and
Stream as:
LPSTORAGE pIStorage;
LPSTREAM pIStream;
I create the (temporary) file using:
hr=StgCreateDocfile(0,
STGM_CREATE | STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_DIRECT,
0, &pIStorage);
When I enter the code such as the line below, as I type "pIStorage->" the
text editor automatic statement completion properly offers the associated
methods pop-up box. Among the options is the CreateStream method. I have
entered the following statement:
hr=pIStorage->CreateStream("CONTENTS",
STGM_CREATE | STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_DIRECT,
0, 0, &pIStream);
When I attempt to compile the functions containing this and other statements
such as pIStream->Write(...), pIStream->Release(), etc. I get error messages
only for those statements referencing IStorage and IStream methods and the
errors say:
error C2039: 'CreateStream' : is not a member of 'IStorage'
see declaration of 'IStorage'
or otherwise as appropriate.
I find this rather confusing since the IDE editor seems to think
CreateStream is a method of IStorage, but the compiler doesn't. As I said,
I'm probably overlooking something obvious in my first go at this. Can
someone please show me the error of my ways?
Thanks!
Don