Skip to content

Blog

gmStudio Release News: Thursday, December 20, 2018

gmBasic is a powerful code transformation tool that reads, interprets, and rewrites VB6/ASP/COM systems for .NET (using C# or VB.NET). We are always improving gmBasic and the core upgrade rule set to make them more robust and flexible so that they produce cleaner, more correct results. This distribution, Version 30.78, includes several enhancements:

  • Improves handling of TabIndex on Labels and Frames to more closely match VB6 Tab Order behavior in WinForms
  • Improves migration of File System ListBox controls to WinForms
  • Adds support for setting Library.ImplicitByRef and Library.AssemblyName in Migrate commands
  • Improves handling of name clash between a class and an enclosed User-Defined-Type
  • Adds support for renaming a User-Defined Types by accepting the migName attribute in the Interface Description Files

gmStudio: Upgrade Solution Development Environment

Section titled “gmStudio: Upgrade Solution Development Environment”

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 making it easier to use. This distribution includes several enhancements:

  • Improves Splash Screen at startup

gmSLAPI: a .NET API for Developing Advanced Upgrade Solutions

Section titled “gmSLAPI: a .NET API for Developing Advanced Upgrade Solutions”

Powered by gmBasic, gmslAPI is a .NET API for automating the gmBasic upgrade engine and accessing the semantic models produced by our unique linguistic compilation technology. gmSLAPI also includes classes to facilitate integrating with gmStudio and managing complex upgrade rules. The API was updated to reflect the latest product improvements and conventions.

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 sample rules were updated to reflect the latest product improvements and conventions.

Great Migrations publishes a number of sample VB6/ASP upgrade solutions to illustrate the capabilities of gmStudio. The sample upgrade solutions were updated to reflect the latest product improvements and conventions.

  • Corrects handling of File System ListBox controls in ScanTool Sample
  • Improves handling of TabIndex on Labels and Frames to more closely match VB6 Tab Order behavior in WinForms

gmStudio Release News: Friday, December 14, 2018

gmBasic is a powerful code transformation tool that reads, interprets, and rewrites VB6/ASP/COM systems for .NET (using C# or VB.NET). We are always improving gmBasic to make it more robust and flexible so that it produces cleaner, more correct results. This distribution, Version 30.78, includes several enhancements:

  • Improves the general ability to produce accurate, build-complete .NET (C# and VB.NET) systems from VB6 code. Most recently, these enhancements were brought to bear on the upgrade of a Property Management application implemented in 44 VBPs referencing 2,520 code files containing 1.9M LOC and 44 third-party-COM components
  • Improves handling of type indicator characters used in variable references
  • Improves handling VB.Data Control and VB.OLE Control
  • Improves handling name collisions between global methods and user-defined types
  • Improves handling handling alternate statement separator in declarations using Global keyword
  • Adds detailed diagnostic logging for Type Interference using <Select TraceChanges=“on”/>

gmStudio: Upgrade Solution Development Environment

Section titled “gmStudio: Upgrade Solution Development Environment”

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 making it easier to use. This distribution includes several enhancements:

  • Improves performance of New Project Wizard
  • Improves various aspects of UI such as list sorting, tooltips, labels, etc
  • Adds option to skip build when running New Project Wizard
  • Adds option to ignore missing COM references when running New Project Wizard
  • Improves integrated .NET build to allow for different versions of VS2017
  • Adds a Splash Screen when starting in GUI mode
  • Improves diagnostic logging at startup feature
  • Improves console logging when running in batch mode
  • Improves syntax highlighting for C# in Side-by-Side viewer
  • Improves performance of running analytics reports
  • Improves file/string hashing to use FIPS compliant algorithm (used for GUID generation and duplicate file / method detection)
  • Improves handling of international character sets by standardizing on UTF-8 encoding
  • Improves performance of Longest Lines report
  • Improves handling of special characters when searching contents of Side-by-Side form
  • Improves handling very large files during Target Code Scan
  • Improves COM description file generator to suppress “numbered duplicate” interfaces
  • Improves performance of task filtering operations
  • Add support for XML declaration element in translation script and gmProj files
  • Improves Author Fix/FileFilter to allow for partial filepath; e.g., just the filename
  • Improves license checking and operation while in Reporting Only mode
  • Corrects problem with adding files to a new ASP project

gmSLAPI: a .NET API for Developing Advanced Upgrade Solutions

Section titled “gmSLAPI: a .NET API for Developing Advanced Upgrade Solutions”

Powered by gmBasic, gmslAPI is a .NET API for automating the gmBasic upgrade engine and accessing the semantic models produced by our unique linguistic compilation technology. gmSLAPI also includes classes to facilitate integrating with gmStudio and managing complex upgrade rules. The API was updated to reflect the latest product improvements and conventions.

  • Modifies sample Program to use gmslAPI.Common.DefaultStartUpFile rather than hard coded startup

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 sample rules were updated to reflect the latest product improvements and conventions.

  • Improves support for Scripting (scrrun.dll) Migration
  • Improves sample batch code in RunGmStudio.cmd

Great Migrations publishes a number of sample VB6/ASP upgrade solutions to illustrate the capabilities of gmStudio. The sample upgrade solutions were updated to reflect the latest product improvements and conventions.

  • Improves sample batch regression test scripts

gmStudio Release News: Sunday, October 21, 2018

gmBasic is a powerful code transformation tool that reads, interprets, and rewrites VB6/ASP/COM systems for .NET (using C# or VB.NET). We are always improving gmBasic to make it more robust and flexible so that it produces cleaner, more correct results. This distribution, Version 30.76, includes several enhancements:

  • Improves the general ability to produce accurate, build-complete .NET (C# and VB.NET) systems from VB6 code (most recently making enhancements needed to upgrade a massive ERP application with 1,366 VBPs referencing 11,739 code files containing 6.1M LOC and 65 third-party-COM components)
  • Improves handling COM file references in VBP files
  • Improves handling identifiers containing international characters
  • Improves handling VB6 App.LogPath and App.LogMode

gmStudio: Upgrade Solution Development Environment

Section titled “gmStudio: Upgrade Solution Development Environment”

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 making it easier to use. This distribution includes several enhancements:

  • Improves flexibility of deployment by allowing the user to specify .NET project file and folder naming conventions as part of each gmStudio project’s settings
  • Improves resolution of Translation Script location for EXE tasks
  • Improves passing command line arguments for EXE tasks
  • Improves whole file search when matches are found at start of line
  • Improves project re-location logic to allow moving from one drive to another
  • Improves reporting of Warning and Note messages in the Translation Log Report
  • Improves support for MSBuild and VS2017
  • Improves ScriptRule feature so Compile\Refactor commands are automatically placed after Compile\Fix commands
  • Improves error handling when Authoring COM Interface Descriptions from a TypeLibs.lst file
  • Improves handling of international characters in script and log files
  • Corrects problem with saving user defaults changes
  • Corrects SyntaxHighlighter to color comments before strings
  • Improves efficiency of running metrics reports from New Project Wizard
  • Improves New Project Wizard to include Metrics details in Project Review results

gmSLAPI: a .NET API for Developing Advanced Upgrade Solutions

Section titled “gmSLAPI: a .NET API for Developing Advanced Upgrade Solutions”

Powered by gmBasic, gmslAPI is a .NET API for automating the gmBasic upgrade engine and accessing the semantic models produced by our unique linguistic compilation technology. gmSLAPI also includes classes to facilitate integrating with gmStudio and managing complex upgrade rules. The API was updated to reflect the latest product improvements and conventions.

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 sample rules were updated to reflect the latest product improvements and conventions.

  • Improves Tab Dialog Control (TabDlg32.ocx) Migration
  • Improves support for Scripting (scrrun.dll) Migration

Great Migrations publishes a number of sample VB6/ASP upgrade solutions to illustrate the capabilities of gmStudio. The sample upgrade solutions were updated to reflect the latest product improvements and conventions.

gmStudio Release News: Wednesday, July 18, 2018

gmBasic is a powerful code transformation tool that reads, interprets, and rewrites VB6/ASP/COM systems for .NET (using either C# or VB.NET). We are always improving gmBasic to make it more robust and flexible so that it produces cleaner, more correct results. This distribution, Version 30.75, includes several enhancements:

  • Improves the general ability to produce accurate, build-complete .NET code systems from VB6 code (most recently making enhancements needed to upgrade a large insurance application with 26 inter-related VBPs referencing 592 code files containing 575K LOC and 34 third-party-COM components)
  • Improves accuracy and readability of certain complex conditional expressions
  • Improves default C# coding style to use lightweight object-oriented coding conventions (formerly, this required the “SubSystem=loc” option)
  • Improves default VB.NET coding style to favor using VB.NET run-time support rather than extension methods
  • Improves handling identifiers containing international characters

gmStudio: Upgrade Solution Development Environment

Section titled “gmStudio: Upgrade Solution Development Environment”

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 making it easier to use. This distribution includes several enhancements:

  • Adds flexibility of deployment by allowing the user to specify .NET project file and folder naming conventions as part of each gmStudio project’s settings
  • Adds options for project task name conventions to better support different types of legacy project naming conventions
  • Adds support for setting CodePage in the .NET project file
  • Adds support for setting .NET Project Type GUIDs needed for WPF upgrades
  • Improves conventions for StartUpObject conventions for WPF upgrades
  • Improves handling of MigrationSupport stub classes in integrated translations
  • Improves handling of international characters in all Search Reporting functions
  • Adds stable-but-unique Project GUID generation for all .NET projects
  • Improves gmStudio About Box Reporting
  • Corrects screen layout issues when running Windows with Text Size greater than 100%
  • Improves Analytics Reports and model Audits to use gmMetrics, a gmSLAPI application
  • Improves default handling of Last Message field to avoid spurious differences between versions of gmProj files
  • Adds support for interpreting foreign language build logs
  • Adds support for using the %ProjFolder% token in Solution File Generator project list
  • Improves log content for Solution File Generator
  • Improves reporting of #INFO messages in Translation Log Reports
  • Adds sort indicators to ListView column headers
  • Improves integration with upgrade tasks using a gmslAPI executable
  • Improves Configuration Form User files listing to include sub-folders
  • Adds support for Form-to-XAML in the Side-by-Side Viewer for WPF upgrades
  • Adds option to skip running translations in Upgrade Wizard thus running only the metrics reports
  • Improves handling of very large (>64MB) log files (e.g., when using diagnostics)

gmSLAPI: a .NET API for Developing Advanced Upgrade Solutions

Section titled “gmSLAPI: a .NET API for Developing Advanced Upgrade Solutions”

Powered by gmBasic, gmslAPI is a .NET API for automating the gmBasic upgrade engine and accessing the semantic models produced by our unique linguistic compilation technology. gmSLAPI also includes classes to facilitate integrating with gmStudio and managing complex upgrade rules.

  • Improves organization of gmslAPI classes with namespaces
  • Improves handling conditions on nested rules in ScriptRules.xml
  • Improves ScriptRules logger to use the LogMessage API

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 sample rules were updated to reflect the latest product improvements and conventions.

  • Improves standard ScriptRules.xml template
  • Improves standard translation templates to assume new C# dialect rather than the deprecated “SubSystem=loc” option
  • Improves Analytics Reports and Audits Reports script templates to use gmMetrics
  • Changes default handling of Line to migrate to MigrationSupport.Line rather than Label
  • Removes SubSystem=loc; The loc conventions are now the default for translation to C#
  • Removes SubSystem=lob; VB.NET bias is now the default for translation to VB.NET
  • Improves migration of VB6 File System Listbox controls to facilitate stub framework integration

Great Migrations publishes a number of sample VB6/ASP upgrade solutions to illustrate the capabilities of gmStudio. The sample upgrade solutions were updated to reflect the latest product improvements and conventions.

  • Samples updated to reflect changes to SubSystem changes
  • Samples updated to reflect changes to MigrationSupport.UI
  • Improves packaging of “All Samples” content

Adding WPF Upgrade Support for VB.NET

Abstract
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:

  • enumerations.xml
  • vbcontrols.xml
  • locSubsystem.gmsl
  • wpfSubsystem.gmsl
  • vb7lang.xml
  • VBASIC.xml

Background
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:

<Select SubSystem="wpf"/>
<Select SubSystem2="loc"/>

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 int and double casts as well as a few other C# patterns relating to data binding:

<pattern id="Top.Set" >
<wpf narg="2" code="Canvas.SetTop(%2d,(double)(%1d))\c" />
<all narg="2" code="%2d.Top = %1d\c" />
</pattern>

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:

<MetaLanguage>
<Enumeration id="Dialects" >
...
<Entry id="wpf" migName="LNG_WPF" value="9" />
<Entry id="loc" migName="LNG_LOC" value="10" />
<Entry id="lob" migName="LNG_LOB" value="11" />
<Entry id="wpb" migName="LNG_WPB" value="12" /> <------ added
</Enumeration>

Returning to vbcontrols.xml, I can add wpb versions of the dailect-specific wpf patterns, for example:

<pattern id="Top.Set" >
<wpb narg="2" code="Canvas.SetTop(%2d,%1d)\c" /> <------ added
<wpf narg="2" code="Canvas.SetTop(%2d,(double)(%1d))\c" />
<all narg="2" code="%2d.Top = %1d\c" />
</pattern>

I find another dialect-specific WPF pattern in VBASIC.XML. This pattern specifies the operation needed to start a WPF application. A VB.NET version is added:

<pattern id="WPO">
<subcode id="SetCanvas">
<wpf narg="3" code="%2d.%3d = %1d\c"/>
<all narg="3" code="Canvas.Set%3d(%2d, %1d)\c"/>
</subcode>
<subcode id="RunProject" >
<wpb narg="4" code="Dim app As New %4d.App : app.Run(%1d)\c" /> <------------ added
<all narg="4" code="new %4d.App().Run(%1d)\c" />
</subcode>
</pattern>

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.

locSubsystem.gmsl
int locCompilerInfo(int dummy1, int dummy2)
{
if(Select.Dialect == Dialects.vbn)
{
if (Select.SubSystem == Dialects.wpb)
{
Select.Subsystem = Dialects.wpb;
Select.Subsystem2 = Dialects.wpf;
Select.Subsystem3 = Dialects.lob;
Select.Subsystem4 = Dialects.loc;
}
else
{
Select.Subsystem = Dialects.lob;
Select.Subsystem2 = Dialects.loc;
}
}
else
{
if (Select.SubSystem == Dialects.wpf)
{
Select.Subsystem = Dialects.wpf;
Select.Subsystem2 = Dialects.loc;
}
}
return 0;
}
wpfSubsystem.gmsl
int wpfCompilerInfo(int dummy1, int dummy2)
{
if(Select.Dialect == Dialects.vbn)
{
Select.Subsystem = Dialects.wpb;
Select.Subsystem2 = Dialects.wpf;
Select.Subsystem3 = Dialects.lob;
Select.Subsystem4 = Dialects.loc;
}
else
{
Select.Subsystem = Dialects.wpf;
Select.Subsystem2 = Dialects.loc;
}
return 0;
}

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.

int hasSubSystem(int theSubSystem)
{
if (Select.SubSystem ==theSubSystem) return 1;
if (Select.SubSystem2==theSubSystem) return 2;
if (Select.SubSystem3==theSubSystem) return 3;
if (Select.SubSystem4==theSubSystem) return 4;
if (Select.SubSystem5==theSubSystem) return 5;
return 0;
}

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:

<gmSL NameSpace="gmSL" class="WPFSubSystem" Source="%UserFolder%\WPFSubsystem.gmsl" />
<gmSL NameSpace="gmSL" class="WPBSubSystem" Source="%UserFolder%\WPFSubsystem.gmsl" /> <-------------- added

I need to recompile the Metalanguage using the modified files. This creates a binary metalanguage file that can be used during the translation process.

With these changes, the WPF feature may be activated by adding one line to a translation script:

<Select SubSystem="wpf"/>

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.