White Papers

The new Science of Information Security

Planning for a Data Migration Project

Is Offshoring for you?

 

Useful Links

Glossary of Internet and Web Jargon

Guide to Hosting Industry Jargon

Search Engines: A comparison

How to use Subject-Focused Directories

Web graphics resources
Template Samples

The Village Quarterly Magazine of the Arts

 
 
Upgrading VB 6 to .NET
Recomendations Resources
  • Install Visual Basic 6.0 on the computer that you will be using for upgrading. In addition to allowing you to test the application, this will ensure that all necessary controls, components, and type libraries are available during upgrade.
  • Visual Basic 2005 has a new set of graphics commands that replace the Form methods Circle, CLS, PSet, Line, and Point.

  • For the Timer control, setting the Interval property to 0 does not disable the timer; instead the interval is reset to 1. In your Visual Basic 6.0 projects, you should set Enabled to False instead of setting the Interval to 0.

  • Visual Basic 2005 has two menu controls, MenuStrip and ContextMenuStrip, whereas Visual Basic 6.0 has one menu control that can be opened as either a MainMenu or a ContextMenu control. All menu controls are upgraded to a single MenuStrip component containing MenuItems for each menu control; you will have to recreate your context menus and delete the extra MenuStrip controls.
  • The Visual Basic 6.0 drag-and-drop properties and methods cannot be upgraded.

  • Variants - When an application is upgraded, the Variant data type is converted to Object. If an application is heavily dependent on variants, this conversion can introduce some subtle differences in the application's behavior.

For example, in Visual Basic 6.0 the expression IsObject(Variant) evaluates to false; in Visual Basic 2005 it changes to IsObject(Object), which evaluates to true.

  • Late-bound object properties cannot be resolved during upgrade.  Change them to early-bound objects.

  • Where possible, you should declare variables of the appropriate object type rather than simply declaring them as the Object data type In the cases where you do use Object and Variant variables in your Visual Basic 6.0 code, we recommend you use explicit conversions when you assign the variables, perform operations on the variables, or pass the variables to a function.

  • Visual Basic 2005 supports overloading functions based on parameter type. For example, the Environ function now has two forms:

 

 

Environ( Expression As Integer) As String
Environ( Expression As String ) As String

Visual Basic 2005 determines which function to call based on the parameter type. If you pass an integer to Environ(), the integer version is called; if you pass a string, then the string version is called. Code that passes a Variant or Object data type to an overloaded function may cause a compiler error or run-time error. Using an explicit conversion will mean your code will work as intended after it is upgraded to Visual Basic 2005.

Using explicit conversions of late-bound objects is good coding practice. It makes the intention of the code easy to determine, and makes it easier for you to upgrade your project to Visual Basic 2005.

  • Earlier versions of Visual Basic support using the Double data type to store and manipulate dates. You should not do this in Visual Basic 2005, because dates are not internally stored as doubles.

  • Visual Basic 2005 does not support parameterless default properties, and consequently does not allow this programming shortcut. When your project is upgraded, Visual Basic 2005 resolves the parameterless default properties, but late-bound usages that rely on run-time resolution cannot be automatically resolved. In these cases, you will have to change the code yourself.

An additional complication is that many libraries implement default properties using a property called _Default. _Default acts as a proxy, passing calls to the real default property. So, when your project is upgraded, some default properties will be resolved to _Default. The code will still work as usual, but it will be less understandable than code written explicitly using the actual property. For these reasons, try to avoid using parameterless default properties in your Visual Basic 6.0 code.

MS VB 6 Upgrade Home

VB 6 Upgrade Assessment Tool

How to: Add Visual Basic 6.0 File System Controls to Your Application

VB 6 to .NET Upgrade BLOG

Help for VB 6 Users

MS Interop Forms Toolkit

Office Development with Visual Studio

Upgrading to VB 2008

 

 

 
 
 
Online Networking and Assoc. Inc.   dennis@onlinenetworking.org