views:

193

answers:

1

Hi

I am making calls to a web service to get data from my dll. I am getting the data in a char* object in parts.

I want to get the whole data into an IStream object. I am running a while loop and getting the data into char* object. Can someone please tell me how I can combine all this data into a single IStream or LPSTREAM object.

Thanks

Never got an answer for this one! Can someone please help!

A: 

Ok I thought I'd answer this one just to help out. You're making calls to another computer so I'm assuming that you are reading in streams of data in char*'s. That's what I get from a comment like "I am getting the data in a char* object in parts."

Therefore, as I understand it, you just want to append the char* string to the IStream object so that it holds the new data.

My suggestion would be to do this:

Create a streambuf object (http://msdn.microsoft.com/en-us/library/aa277891(VS.60).aspx)
While you are recieving packets
    append the packet to the streambuf object (http://msdn.microsoft.com/en-us/library/aa277883(VS.60).aspx)
Create a IStream object and init it with the streambuf object (http://msdn.microsoft.com/en-us/library/aa277365(VS.60).aspx)

Now that should work I think. That will fill your IStream object with the stream you got from the website.

I hope that helps, Robert

Robert Massaioli