Visual Basic

  1. Home
  2. Computing & Technology
  3. Visual Basic
The VB.NET Upgrade Wizard
Need To Upgrade VB 6 to VB.NET? Consider This First!


the upgrade idea

Gary Cornell, distinguished co-founder of APress and all around VB.NET guru had this to say about the VB.NET Upgrade Wizard in his book, Programming VB.NET - A Guide for Experienced Programmers.

The Web is full of articles about the differences between VB 6 and VB.NET. Most of these are long lists of differences ... additions, changes, deletions. Just browsing these lists is a real cure for insomnia.

But few of them take you completely through an actual conversion. That's what we're going to do in this article. We're going to migrate the TicTacToe program from a previous Spotlight article and move it to VB.NET. In the process, you'll see that Gary is pretty much right in his "humble" opinion.

 Related Resources
• The VB 6 Version:
TicTacToe

• A GDI+ Introduction for Visual Basic 6 Programmers
• A GDI+ Introduction for Visual Basic 6 Programmers
• Source for Upgraded .NET Version
 


This is the second article in a series that starts with an explanation of the Tic Tac Toe program for beginners and ends with a completely recoded version in VB.NET. The Tic Tac Toe program is an excellect way to demonstrate some fundamental principals. In this program, we'll see why it's often not a good idea to rely on the Microsoft Upgrade Wizard to convert your programs to VB.NET. Although I create a program that ... well ... does work, you will see that using the base created by the Upgrade Wizard misses the main advantages offered by VB.NET. The next article in this series goes even further in trying to create a converted program and is also a tutorial on using GDI+, Microsoft's new graphics system.

There are good reasons why there aren't a lot of conversions of programs from VB 6 to VB.NET documented on the web:

  • It's a long process for most programs. The conversion is often complex and detailed.

  • Converting just one program fails to cover more than a fraction of the actual conversion problems you will run into. Documenting only the problems that come up in one case is like a tourist who thought he had been to Paris because he changed airplanes at the airport. So keep in mind that the goal of this article is really to show you an example that should help convince you that the Upgrade Wizard isn't so "wizardy."

  • There are a lot of options that depend on local circumstances. For example, the standard version of VB.NET doesn't include the Upgrade Wizard. (To get it, Microsoft wants you to buy the whole Visual Studio suite! But there is a way around that which will work for a few projects if you're in a bind.)

But probably the best reason that there aren't a lot of articles about the conversion process is that converting VB 6 programs to VB.NET just isn't a very good idea. Gary Cornell goes on to say this in his book:

"You may be tempted to think that you can use the conversion tool and a little bit of fiddling to move your VB programs to VB.NET. Do not go down this path."

The bottom line is that VB 6 and VB.NET are so different that you will almost always benefit from simply starting over and creating a whole new program the VB.NET way. Let's see where a conversion gets us in the TicTacToe program.

Next page > How to Convert > Page 1, 2, 3, 4, 5, 6, 7, 8, 9

Explore Visual Basic

By Category

About.com Special Features

Build Your Own Website

Step-by-step advice on how to do everything from choosing a Web host to promoting your content. More >

Connect Your Home Computers

Easy ways to connect two computers for networking purposes. More >

Visual Basic

  1. Home
  2. Computing & Technology
  3. Visual Basic

©2009 About.com, a part of The New York Times Company.

All rights reserved.