Windows 7 was released to the general public by Microsoft in October of 2009 (my how time flies). Since that point many home users and even more businesses have been upgrading their PC’s to make use of this solid Windows platform. Most people are in agreement that Windows 7 is head and shoulders above Windows Vista. This makes sense because with Vista Microsoft focused a lot of time and energy on adding “cool new features” whereas the Win8 focus was on compatibility with previous applications and hardware and better security, usability, and performance.
So where does that leave us? The great news for us Visual Basic 6 developers is that since Microsoft focused so heavily on compatibility, all of your VB6 apps will work straight out of the box. This is by far one of the greatest benefits us Windows developers have over Mac or other operating systems. Year after year Microsoft comes out with great applications and operating systems that push the envelope of what the hardware can handle and along the way they carry all of our “legacy” VB applications along on the wave.
Some great new things that Windows 7 brings to the party are its new shell, its slick taskbar (now called the Superbar), and it’s easy to set up network support. The other important thing is what is not there. With this release they quit packaging all the extra apps that no one ever used (such as calendar, mail, chat, etc.). Note you can still download them if you want but they won’t be installed by default. If your VB application made use of any of these “out of the box” apps you will want to now check if they are installed and if they are not provide a link to the Windows Live Essentials suite that your customers can use to download that much needed program.
So my VB apps will run with no problem on the new Win7 boxes but what about the Visual Basic 6 IDE? You know the thing I still have two normal CD’s sitting a hug box with the original “programmers guide” that collects dust on my shelf? Just like the programs you developed, the VB IDE will run with no problems on Windows 7. You might see a notice as you install it that there could be compatibility defects, but I have been running it for over a year without a single issue. So don’t stress about upgrading your home or business personal computer. You will be able to continue to run that slick and simple VB Integrated Environment.
Now that we know our great Visual Basic applications can live on past 2010 and we know we don’t need to send an email to all our clients telling them not to upgrade what things should we be careful of as we continue to develop in VB6? Or what things should we check in our released applications to verify they still work.
The main things to focus on are exactly what you would expect – what common sense would tell us. For example if you have any VB6 API declarations you call directly you might want to verify that they still function the way you would expect (hint 99% of the time they do because they are the same API’s every C, C++, VB, Delphi, and any other windows application hit). The other areas you want to check out are any that do “non-standard” windows behavior. For example if you did a bunch of tricks to make a label cover part of the title bar it might be screwed up with the new chrome and title area. Same goes for taskbar or toast popups.
The last thing you might want to consider with a new release of Windows being out is how you can upgrade the look and feel of your applications to make them blend in more with the Win7 look. The best thing you can do is install Windows 7, play around with some of the applications that “fit” with the new look, then run your application and see what stands out like a sore thumb. Write everything down, prioritize it, and then get to work. Many times with just a feel tweaks to your color scheme, icons, and layout you can get that “old” app looking pretty spiffy.
How about you? Please post a comment if you have had luck running your VB6 applications on Windows 7 (or if you haven’t had luck feel free to vent to us).
Everything I’ve mentioned so far is well and good but how about some details. Below I have the results of me trying our top 5 VB Applications and code snippets on this site. I ran all of these on a Windows 7 box in the VB6 IDE. With nothing special done (except for running in Admin mode as noted in the comments below). See for yourself how Windows7 handles VB 6.
1) VB6 type ahead combobox: This tutorial has been wildly popular at our site primarily because it gives a great introduction to a common VB control. Not only does it introduce this simple control it builds upon it to build one of the most useful and “fancy” features around (similar to what Google now has – but years ahead). Here it is running on Windows 7 with no problems whatsoever:
2) VB6 pdf tutorial: This tutorial allows you to create PDF files from within Visual Basic with out any third party controls. It makes use of only one .bas file that can be called into for all your PDF needs. One note on this sample. If you run it not in Admin mode you will see this message box when you click the button:
This is because the sample tries to save the pdf file in the same location the program is running. You can solve this by either running in admin mode or by changing the code to write the file to an allowable area (such as my documents). After you do this you can open the file and see:
3) VB6 Number Format: This tutorial walks through different ways you can format numbers, currencies, and percent's. It is a simple example that exercises all the different number related functions
4) VB Calculator Sample: When learning a new programing language a common first application to write is the classic calculator. This is also a great application to verify on Windows 7 as it not only uses many of the built in VB functions, but it also makes use of the standard windows controls.
5) VB Date Functions: Another set of functions that are used often when writing Win programs are the Date and Time functions. We put the sample code from this tutorial to the test and discovered that once again it all worked great!
Although we didn’t cover every tutorial and source sample we have on this site, virtually all of our VB6 Tutorials and VB6 source samples will work great on Windows 7. Go check them out and please report back in the comments section below if you find any issues.