VBCorLib for VB6

Monday, June 06, 2005

Console Crashes on Exit

It has finally been brought to my attention that when using the Console and you exit a compiled application it crashes! I tracked down the problem and fixed it. I cannot actually see why the problem exists. I have given up on trying to understand why it breaks and just made it work a bit differently. The fix will be included in the next release of course, but what to do in the meantime? Well, thankfully VBCorLib is so flexible, you can fix it temporarily by inserting the following code before the first usage of the Console.

Dim sw As StreamWriter
Set sw = NewStreamWriter(Console.OpenStandardOutput, Encoding.ASCII)
sw.AutoFlush = True
Console.SetOut sw

This will make the Console use a different encoding when writing.

0 Comments:

Post a Comment

<< Home