A handful of recent customers allowed us to publish brief descriptions of their VB6/COM upgrade projects and their testimonials of success with gmStudio. Learn how small teams successfully completed large, ambitious VB6/COM upgrade efforts with the help of gmStudio. Read the case studies
The gmStudio distribution includes a sample demonstrating an upgrade of VB6 forms to WPF. This sample was originally implemented for C# only. In this release, we added a WPF sample for VB.NET and published a blog article to describe how we did it.
gmBasic is a powerful code processor that reads, interprets, and rewrites VB6/ASP/COM systems as .NET (C# or VB.NET). We are always improving gmBasic so that it is more robust and flexible and it produces cleaner, more correct results. This distribution, Version 30.44, includes several enhancements:
Powered by gmBasic, gmStudio is a development environment for creating high-performance, custom VB6/ASP/COM to .NET upgrade solutions. We are always adding functionality to gmStudio and also making it easier to use. This distribution includes several enhancements:
gmStudio ships with a collection of sample upgrade rules that can be used to add custom features to your upgrade solution. These XML documents and gmSL scripts are distributed as source that you may modify to fit your unique requirements. The latest distribution of sample rules files includes several improvements:
Great Migrations publishes a number of sample VB6/ASP upgrade solutions to illustrate the capabilities of gmStudio. The samples were updated to reflect the latest product improvements and conventions.
The gmStudio distribution includes a sample demonstrating an upgrade of VB6 forms to WPF. This sample was originally implemented for C#. The purpose of this article is to describe how we added a WPF sample for VB.NET and provide insights into advanced customization. The work required changes to the following metalanguage files:
A Subsystem is a collection of related upgrade rules that provide a specific upgrade feature. The current WPF/C# sample uses subsystem=wpf and subsystem=loc (light-weight object oriented C# coding style). The two subsystems are activated by adding two commands to the translation script:
Generally speaking, the WPF/VB.NET sample will be analogous to the WPF/C# sample. However, the problems are in the details: I initially find the WPF subsystem contains several C#-specific patterns in vbcontrols.xml; for example, there are
double casts as well as a few other C# patterns relating to data binding:
What is needed here is a VB.NET form for some WPF operations. This is analogous to the situation with
SubSystem=loc/lob where some patterns need both a VB.NET and a C# form. For WPF we will need a pair of subsystems, wpf/wpb, for C#/VB.NET respectively. The new subsystem is added to enumerations.xml:
Returning to vbcontrols.xml, I can add wpb versions of the dailect-specific wpf patterns, for example:
In order to activate the new wpb subsystem, I need to modify the CompilerInfo handlers to include wbp in the Subsystem stack for Dialect=vbn. The CompilerInfo handlers are gmSL routines that are called by the tool when it begins processing the Compile command in a translation script. There is a CompilerInfo handler for Subsystem=loc and I will add one for SubSystem=wpf. The change must be made to load the subsystems in the correct order of precedence based on the selected .NET language dialect.
There are several places in authortext.gmsl testing for the presence of a subsystems. For these more complex multi-subsystem scenarios, they may also need to check SubSystem2, Subsystem3, etc. authortext.xml must also be modified to allow for this. A utility function, hasSubSystem, will be used to help make these tests in a consistent way.
Several other simple changes relating to default assembly references and Imports statements were needed to support WPF for VBN. These are done by modifying in authortext.gmsl.
A critical part of supporting the WPF upgrade relates to authoring XAML from the VB6 forms and declaring the WPF Application class. This work is done in the wpfSubSystem.gmsl script. This gmSL script contains various upgrade event handlers and supporting routines that are called by gmBasic at the appropriate times during the authoring process. Support for VB.NET was added by making the code in wpfSubSystem.gmsl dialect-specific: adding logic to author either C# or VB.NET code depending on the dialect setting.
Next, I add an entry to VB7Lang.xml so that both the wpf SubSystem and the new wpb SubSystem will invoke the upgrade event handlers implemented in WPFSubsystem.gmsl:
The above now works for both Dialect=csh and Dialect=vbn. Note: the WPF upgrade subsystem is a limited implementation: it supports most VB6 intrinsic controls and the COM TabControl (TabDlg). Additional VB6/COM controls and other features may be added by modifying the appropriate language scripts and COM description files. Contact us if you have any questions.
A number of our recent customers allowed us to publish brief descriptions of their VB6/COM upgrade projects and their testimonials of success with gmStudio. Learn how small teams successfully completed large, ambitious VB6/COM upgrade efforts with the help of gmStudio.