Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the length of IStream? C++

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:

image->Save(stream, Gdiplus::ImageFormatBMP);

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...

thanks!

like image 977
Schwertz Avatar asked Oct 13 '09 16:10

Schwertz


People also ask

How do you define Istream?

This class defines members that are independent of how the templates of the class are defined. istream Class − The istream class handles the input stream in c++ programming language. These input stream objects are used to read and interpret the input as a sequence of characters. The cin handles the input.

What type is Istream?

istream and ostream serves the base classes for iostream class. The class istream is used for input and ostream for the output.

What is a C++ stream?

A C++ stream is a flow of data into or out of a program, such as the data written to cout or read from cin. For this class we are currently interested in four different classes: istream is a general purpose input stream. cin is an example of an istream.


1 Answers

IStream::Stat should do what you want.

like image 73
Christopher Avatar answered Oct 16 '22 12:10

Christopher