VB6 Migration First Steps

The following steps describe a basic migration of a Visual Basic 6 Application to a Web Application based on Wisej.NET.

General Approach

Usually, the migration from Visual Basic 6 (VB6) desktop application to Wisej.NET web applications is a 2 step process:

  1. Migrate from Visual Basic 6 to .NET WinForms (C# or VB.NET) desktop application

  2. Migrate from .NET WinForms to Wisej.NET web application

This chapter is going to describe the first step as the second step is not any different from the migration of a native .NET Desktop application and this migration is described in detail here.

While the resulting application of step 1 can be used to test for backward compatibility, full functionality coverage, etc., this is entirely up to the project and an optional procedure. Alternatively, you could also delay some implementation work until after the 2nd step (like replacing third-party components, etc.).

Professional services and turn-key migration solutions are available from the makers of Wisej.NET and a number of international partners. Get in touch! We have the knowledge, tools, and libraries to support you in the Porting Process.

From Visual Basic 6 to .NET WinForms (C# or VB.NET)

Migrating from Visual Basic 6 to .NET WinForms (C# or VB.NET) can be done by completing the following tasks:

Transform Syntax from Visual Basic to C# or VB.NET

All code elements have to be converted from Visual Basic to their .NET equivalents. This includes converting

  • Operators (like AND and OR to & and |)

  • Declarations of Variables (from DIM to an instantiation)

  • Data Types

  • Case Sensitivity

  • and a lot more

Keep older concepts by using a function library (optional)

Sometimes it makes sense to keep some existing concepts that are not existing 1:1 in the .NET environment. Function libraries can help you in such cases that handle for example the RecordSet coming from RDO (Remote Data Objects)

Map visual components to wrapper components

Very often you can´t just replace a Visual Basic component with a .NET component. This is where you need to work with wrapper components that bridge between the Visual Basic functionality and interfaces and the .NET equivalents. These wrapper components can include Buttons, TextBoxes but also Third Party Controls.

We recommend reusing existing libraries that contain these wrapper components coming from many projects and have proven to provide a smooth migration.

Determine and adjust execution context

All existing qualifications of methods, variables, etc. need to be reviewed, determined, and adjusted to the correct .NET context.

Call by reference challenge

In Visual Basic 6, every method call transfers its parameters by reference but you can still use variables, properties, or even fixed values for them.

In .NET this is only possible by adding the ref keyword (C#) and so a simple compilation after conversion would fail.

A typical solution for this is to add function overloads that finally end up in the same implementation method and handle all input and output parameters.

This task can be supported and unified by using a compiler like Roslyn and a set of defined transformation rules.

From .NET WinForms to Wisej.NET

The migrated .NET WinForms application can now be transformed into a Wisej.NET web application like any other .NET application.

Learn about the steps, considerations, and benefits here.

Last updated