VB 6.0 in Windows 7

Visual Basic 6.0 will be supported under Windows 7. That means ten more years of runtime being shipped with OS and all applications “just working”. This support is for runtime and supported runtime files (mostly those that came with it). There is no support for controls that were not part of VB 6 delivery (some VB 5 compatibility files).

Development environment (IDE) hasn’t had same fortune. It’s officially supported life already ended but it does work fine on Windows 7 beta 1. I just hope that it will stay like that for final version also.

MobiReg - Beta 1

Illustration

I created small registry editor for windows mobile devices. With it you can browse your registry and perform whatever change you wish. It supports string, binary, DWord (32-bit), QWord (64-bit), multi-string and expandable-string data types. Additionally to that, there is support for both Smartphone (Windows Mobile Classic) and Pocket PC (Windows Mobile Professional) platform in single executable.

You can download first beta here (cab installer) [2009-04-21: final version is out]. In order to run it, you may need .NET Compact Framework 2.0 or higher (if it is not already installed).

Starcraft Color Problem

[2010-08-12: It seems that perfect solution is found. Start reading article from bottom. :)]

Illustration

I like Starcraft. Both playing and watching it. However, since I installed Windows 7, each time I run it, screen goes into weird color. Half of color palette just goes into cyan.

This is usually restricted to menus. Once game starts, everything looks fine (ok, water has artefacts too), but from time to time, whole game gets garbled. There is nothing to do other than exiting game.

I tried various settings on compatibility mode without real success. Setting compatibility mode to Windows XP (where game looks good) made things even worse since Starcraft started reporting that it cannot load a file (font\font.gid). Neither combination of settings got palette problem solved.

Unrelated googling threw me a solution. Just open Screen Resolution window and run Starcraft (with that window still open). Colors are as they should be.

I haven’t tested this on Vista yet, but if you have a same problem, it is worth a shot.

Why exactly this works - I have no idea.

Illustration

[2009-03-06: Notice that you still need some compatibility settings. Here are ones that work for me in Windows 7. Disabling display scaling enables me to have higher DPI (120%) and still use my map (otherwise, place I select on map isn’t place where I end up). Without disabling desktop composition, I cannot even switch to game and without administrative rights you may stumble upon some problems if you are running from Program Files folder (write forbidden for normal users). Checking other stuff didn’t make anything better, so I left it off.]

[2009-06-09: With Windows 7 RC, things got worse. Even with every checkbox selected, Windows 95 compatibility mode and resolution screen open, I cannot reproduce proper screen every time. Sometimes it works properly, sometimes you can get it to work by pressing Alt+Tab repeatedly, and sometimes it is best to exit and enter again.]

[2009-08-28: This workaround works for final version of Windows 7. It does not work every time but success ratio is well over 50%.]

[2010-08-12: One annonymous commenter suggested solution that includes registry changes. All I can say is that it really works. I did test it only on Windows 7 (64-bit version) and it works perfectly. I do hope that it works on other versions (Vista also). I took liberty of packing those two hacks into one zip file. Do leave comment if you find it working (or not) on other versions.]

[2017-04-19: With patch 1.18, issue is finally resolved.

Edit and Continue

Illustration

Long time ago, I have sinned. Yes, I used Visual Basic 6.0 to make programs. Even worst, I got paid to do so.

My work involved working with medical devices (oh, AxSYM, how I miss you…) there was one killer feature for me. Ability to set breakpoint, change some code and resume from that point was priceless. I would connect to device, when something in communication goes wrong, I would edit code in place, fix a bug and continue onto next packet. I could afford myself to be lazy (ok, there were timeouts to consider) and fix few bugs that occurred in single session. How did I liked it.

When .NET came I was missing that feature. I cannot say I was too sorry for old VB since new VB.NET was so much more powerful, but some things took a little more time and concentration to be done.

For Visual Studio 2005, there was a treat for me. They reintroduced that very same feature as “Edit and Continue”. It wasn’t as good as one in Visual Basic 6.0, even small changes would force you to restart, but smaller adjustments were possible. Life was good.

Recently, I switched to 64-bit system. I figured that since 64-bit systems were gathering momentum, so should I.

Illustration

It was not as smooth transition as I hopped. There were driver problems, non-working 16-bit programs, some API calls that kept failing since I had int instead of IntPtr. All those things are nothing compared to not having “Edit and Continue” again.

Not only that I lost it, there is stupid dialog that reminds me of it every time. You can turn whole feature off in order to prevent that annoying dialog, but then you cannot play with it even on 32-bit applications (yes, feature still works if you compile for x86).

I do not use it often anymore. It is just to annoying to switch between Any CPU and x86 platforms. However, when I have some weird problem at hand, and I see that lot of debugging is involved, switching temporary into 32-bit world is small price to pay.