I'm creating an IStream as follow:
IStream* stream; result = CreateStreamOnHGlobal(0, TRUE, &stream);
Then I have a CImage object that I save to this stream:
I need to get the size of bytes written to this IStream.
How can I do this?
There is no Length or something like this in the IStream...
IStream::Stat should do what you want.
Or you can use:
ULARGE_INTEGER liSize; IStream_Size(pStream, &liSize);
other functions you might find useful in this context:
IStream_Reset(pStream); // reset seek position to beginning IStream_Read(pStream, mem, size);