Archive for July, 2008

StringBufferInputStream has been deprecated; the documentation recommends you use StringReader instead. Yet, many stream-related methods in other classes (often those that predate the deprecation) will only accept an InputStream. So, how to send an InputStream that came from an in-memory string?
One easy alternative is to use ByteArrayInputStream.
Following is a sample snippet.
Instead of 
InputStream is = new [...]


While programming for COM, you must have encountered this annoying “Server Busy” dialog box. This happens when the MFC COM Client is calling some method in the COM Server, that takes a long time to process. Until the method returns, nothing can be done in the client side and this dialog box pops up.
To deal [...]