Help with a Memory Stream issue

  • Thread starter Thread starter David
  • Start date Start date
D

David

I have a funtion that returns a MemroyStream, but the MemroyStream may
or may not be return a stream with data if there is an error in the
function. What is the proper way to return a MemroyStream to the
caller so that they will have no issues? I could return a NULL, but
this raises other issues.

Thanks
 
I'd suggest you throw an exception in the case of error, that way the caller
knows it is always going to get a valid stream back. Of course, I don't know
what your function is actually doing so that might not be the best way.
 
Back
Top