Skip to content

Blog

Great Migrations FAQ Published

We recently gathered up the Q&A articles we have written over the years and moved them to this location in the public section of this WIKI. The articles cover topics ranging from general tool use, to methodology concepts and practices, to common problems and solutions.

Check it out and Contact Us or post your comments if you want additional information. Enjoy!

VB6 Hangs In there! (and hangs around beyond its welcome)

I happened to notice this article Popularity Index: Classic Visual Basic Hangs In There — Visual Studio Magazine regarding the ongoing popularity of VB6 in the world of programming.

It’s true: we do get a lot of inquiries, from all sorts of companies, who are still building and running VB6/COM apps. Most of these applications are at least 200K lines of code and a few are over a million LOC. Despite the increasing risk of depending on VB6, these legacy systems persist as VB6 because they deliver value. I will add that, in every case, the technical teams that maintain these VB6 applications understand they must get off VB6 sooner or later, but they struggle make the upgrade project a business priority. In some cases, we find organizations have tried and failed to “just rewrite” their legacy systems ending up with a “partway there system” — with some .NET around the edges and a big mass of mature VB6 functionality at the center. The fact is that rewriting large systems requires a generous investment of vision, creativity, experience and resources.

Nevertheless, for the vast majority of these companies, moving their systems from VB6 to something else is a matter of survival. We believe ambitious upgrade projects require a new paradigm: new tools and methods. That is what we are building at Great Migrations. Read through the articles on this portal and Contact us if you want to learn more.


gmStudio Release News: Monday, 20-July-2020

Project Success Story: 17 VBPs, 380K LOC VB6, 33 Custom Upgrade features, 6 months

Section titled “Project Success Story: 17 VBPs, 380K LOC VB6, 33 Custom Upgrade features, 6 months”

Great Migrations recently assisted a client in the migration of a large specialty insurance system from VB6 to C#. Our tools and methods dramatically accelerated the client’s digital transformation initiative while lowering cost and risk. Learn more from this article and testimonial on the Great Migrations portal.

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 leading electronic medical records (EMR) product. This EMR system was both large: 1.8M LOC implementing 85,000 methods, contained in 7000 unique code files, organized by 153 inter-related VBPs, and complex: having over 4000 Implements statements, extensive interface inheritance, and heavy use of over 200 external COM/Interop libraries. This distribution, Version 31.12, includes several enhancements:

  • Improves consistency of class members that implement interface members
  • Improves accuracy of resolving and preserving interface inheritance
  • Improves support for recognizing module members qualified by the project name, the module name, or both
  • Improves support for user-defined Font properties
  • Improves GoSub refactoring to make extracted GoSub routines private
  • Improves GoSub refactoring to handle properties containing GoSubs
  • Improves recognizing and migrating abstract Control references
  • Improves migrating indexer expressions involving weakly typed collections
  • Improves migrating code using Abs in bitwise operations
  • Improves setting scope of user-defined types
  • Improves resolving naming conflicts between enums and classes
  • Improves support for migrating properties where the getter’s return type differs from the setter’s value type
  • Improves migrating passing a unary operation by ref
  • Improves migration of Select-Case using LCase/UCase(literal) expressions as Case arguments to switch-case (C#)
  • Improves migration of Select-Case using a type Single expression as the Select argument
  • Improves Refactor/Migrate command to allow modifying the uuid associated with a designer coclass
  • Improves low level handling of code using extended character sets
  • Improves support for ComboBox/ListBox NewIndex Property
  • Improves resolving object versus default property on LHS of an assignment
  • Improves detecting and migrating event handlers for ControlArrays that do not follow standard conventions
  • Begins major improvements to late-stage type inference for symbols of type Object in code and COM interfaces

gmStudio: Upgrade Solution Development Environment

Section titled “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:

  • Improves Visual Studio Solution File generation
  • Improves Translation Search Results by reporting the member that contains each match (C# only)
  • Improves .NET Build Log Report by reporting the member that contains a given error (C# only)
  • Improves order of fields in .NET Build Log report
  • Adds Compare IDF Files operation from References context menu
  • Adds Compare Source Files operation from Source Metrics context menu
  • Adds Open File Location operation from References context menu
  • Adds Open File Location operation from Source Metrics context menu
  • Improves IDL Author to warn when a hidden class is skipped

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 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.

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.

  • Refactor.Mscomctl.ocx.xml: Improves MSComCtlLib.ListView.SubItems 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.

  • Improves MSComCtlLib.ListView.SubItems migration in FileExplorer sample
  • Improves Handling of Select Case in FMStocks

gmStudio Release News: Wednesday, 29-April-2020

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

Section titled “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

Section titled “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.

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

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

gmStudio Release News: Thursday, 27-February-2020

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 electonic medical records application and improvements for the migration of error handling . This distribution, Version 31.04, includes several enhancements:

  • Improves the error handling migration of methods that used On Error GoTo, GoTo, and Resume, etc. to methods that use try-catch
  • Improves resolving ambiguity due to a const/class naming clash
  • Improves support for array arguments to event handlers
  • Improves support for enum properties assigned to an undefined numeric quanity in the VB6 designer code
  • Improves support for stubbed Color properties
  • Improves support for stubbed IntPtr properties
  • Improves support for cases of weakly typed symbols being used in index expressions
  • Improves support for new operations on classes also used as implemented interface
  • Improves support for COM classes that have names clashes in their interfaces
  • Improves support for references to COM constants
  • Improves support for optional parameters to reference type with a default of 0
  • Improves support for IIf used with reference types
  • Improves support for recursive interface methods
  • Improves support for methods declared with UserControl parameters
  • Improves support for COM event handlers that return a non-void type (C#)
  • Improves support for recognizing references to COM indexers
  • Corrects an issue with the GenericCollections upgrade
  • Corrects an issue with complex conditional expressions of functions with enumeration parameters
  • Improves the CodeStyle Feature adding support for limiting consecutive blank lines in generated code
  • Improves support for recognizing members of derived class overriding members of base class
  • Improves migration of Const symbols to static readonly symbols when required
  • Improves handling of statement separators in Select-Case statements
  • Improves handling parameterized properties

gmStudio: Upgrade Solution Development Environment

Section titled “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 VS2019 integration
  • Adds open with command prompt from gmStudio View Menu when using Control-Click
  • Adds ScriptRule activity reporting to Translation Log
  • Improves Peek Reporting mode to display variable lines above/below matching record
  • Improves Batch Control form to allow setting session log listing max lines
  • Improves RESX Folder conventions to use SrcName rather than MigName-SrcName
  • Improves Migration Project Name validation
  • Adds support for viewing scripts separate from logs in the information panel

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 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.

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 Tab Control Migration to preserve zOrder of contained controls
  • Improves Tab Control Migration to set SizeMode to account base on Style if needed
  • Adds sample for vsFlexLib.vsFlexArray migration to WinForms.DataGridView

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.

  • Adds a new Sample, VBScan, a VB6 parser/reporter that also illustrates upgrading the Microsoft Outline Control to WinForms Treeview-derived control
  • Updates all Samples to target Visual Studio 2017 by default