Blog

Blog from April, 2020

gmBasic: Upgrade Engine

gmBasic is a code transformation tool that reads, interprets, and rewrites VB6/ASP/COM systems to one of the .NET languages (C# or VB.NET). Based on feedback from our clients and migration projects in the field, we are continuously improving gmBasic so as to help users more easily produce cleaner and more correct results. Most recently, this work included the general improvements needed to produce build-complete C# code for a 1.8M LOC electronic medical records application and a 500K LOC Architectural Design system. This distribution, Version 31.08, includes several enhancements:

  • Improves handling of parameterized properties
  • Improves handling of ControlArray event handlers
  • Improves recognizing references to VB6 intrinsic functions fully qualified with the VBA.Interaction module name
  • Improves storing symbol table information for identifiers declared with WithEvents
  • Improves handling of the Unload statement when used in a class module
  • Improves handling of Controls.Add operations
  • Improves performance and accuracy of type inference
  • Improves handling of mathematical expressions involving Byte and Double
  • Improves recognizing references to elements of an array of Forms
  • Improves handling of references to ControlArray.LBound
  • Adds support for migrating Control.DataMember property to MigrationSupport methods
  • Improves handling code that implicitly uses a control's default property as a Select Case argument
  • Improves handling name clashes between global Main method and Form named Main
  • Improves migration of VB6 constants to .NET Colors
  • Adds a gmSL event, EditSource, that is raised after the code is loaded and may be used to invoke custom source code pre-processing
  • Improves handling of type Byte as a small integer quantity
  • Improves handling of COM enumerations declared using typedef
  • Improves handling naming clashes between properties and enums
  • Improves handling inconsistencies in byref status of parameters in interfaces and implementors
  • Improves authoring and using cross-library inheritence relationships in interface description files
  • Improves recognizing global module members explicitly referenced as children of the VBP
  • Improves handling forward references to classes that are also migrated to interfaces
  • Improves handling changes to Font members made through Font wrapper properties
  • Improves recognizing complex types used as members of user-defined types
  • Improves handling complex enumeration members as const initializers
  • Improves logic to correct assignments of reference types to 0
  • Improves support for Collection.Remove operations
  • Improves support for initializing a Font from source type stdole.StdFont
  • Improves support for retaining strong types for polymorphic variables
  • Improves logic to correct passing arguments that are incompatible with the parameter
  • Improves Table-based reports generated from gmSL commands in gmPL scripts to use StripTrail=on
  • Improves handling comma-delimited lists of values in a Const declaration
  • Improves handling name clash between Form member and intrinsic function (e.g., Left)
  • Improves handling name clash between a user event and a global type (e.g., Timer)
  • Improves support for comparing a Single and an Enum entry
  • Improves handling variant arrays inferred to be strongly typed arrays
  • Improves handling COM APIs with class names with the same name as the containing library
  • Improves migrating On Error GoTo to try/catch
  • Improves handling unary minus with Enum entries
  • Adds support for migrating the Control.UseMaskColor property to MigrationSupport methods
  • Improves handling undeclared local variables that clash with global symbols
  • Improves handling inconsistency in events declarations in their interface and in the implementing class
  • Improves handling ambiguity of an object reference versus default property reference
  • Improves migration of calls passing a Handle argument as an IntPtr Parameter
  • Improves handling of indexed ControlArray expressions
  • Improves handling of Control.CurrentX/CurrentY properties
  • Improves support for using COM UIID when migrating CreateObject
  • Improves handling Dim statements in Select Case blocks
  • Improves migration of CommandButton.Default to Form.AcceptButton
  • Improves migration of Integer quantities to .NET Colors
  • Improves handling of idiomatic VB6 test for empty array using (Not Array)
  • Improves migration of numeric constants to user-defined enumeration entries
  • Improves handling calls passing weakly typed form argument to a strongly typed form parameter
  • Improves handling forward-declared Implements relationships
  • Improves handling multi-level interface inheritance relationships
  • Improves migration of NewEnm in user-defined collections to Enumerable in .NET
  • Improves propagation of name changes made for .NET naming conventions in code
  • Corrects the metalanguage definition of InputBox to allow specifying Default as a named argument
  • Improves CodeStyle operation adding support for a AllowBlankLines feature

gmStudio: Upgrade Solution Development Environment

Powered by gmBasic, gmStudio is a development environment for analyzing code and developing custom VB6/ASP/COM to .NET upgrade solutions. We are continuously adding functionality to gmStudio and making it easier to use. This distribution includes several enhancements:

  • Adds support for modifying Load element in translation scripts using ScriptRules
  • Adds Log-only and Script-Only options for the Translation and Deployment information
  • Improves Edit Visual Studio Solution Project List File action to generate a default file if needed
  • Adds Filter from Selection item to the Search Results Context Menu
  • Improves support for gmSL-based project tasks
  • Improves Edit Refactor Library command to use MigrateIDF to generate files starter files when applicable
  • Improves Explorer integration for creating an initial upgrade solution for a folder or vbp
  • Adds a check and displays a warning if the Visual Studio version specified in the gmproj file is not installed
  • Corrects SetEnv.cmd logic that initializes MSBuild environment for batch build processes

gmslAPI: a .NET API for Developing Advanced Upgrade Solutions

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

Sample Upgrade Rules

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. See also additions and changes in gmStudio Extensions Repository.

  • Improves CodeStyle.std.xml adding a sample of the AllowBlankLines specification
  • Adds COMDLG32.OCX.gmSl and comdlg32.ocx.Refactor.xml for migrating Common Dialog to WinForms
  • Adds mig.MSCOMCT2.OCX.Winforms.xml for migrating Windows Common Controls 2 to WinForms
  • Adds mig.Threed20.WinForms.ocx.xml for migrating Sheridan Controls to WinForms
  • Adds MSOUTL32.ocx.Refactor.xml form migrating MS Outline Control to a WinForms TreeView-derived control

Sample Upgrade Solutions

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 VBScan sample to use Migration Rules files rather than custom IDFs
  • Improves all samples by linking the Debug build of the MigrationSupport.dll