Skip to content

Blog

Samples changed to demonstrate different approach for deep migration

The Dec-2019 Release introduces a change in how some of the samples do COM API upgrades.

In prior releases, the deep migration work in the samples was partially done by DLLs developed using our C-based API (gmNI). gmNI is not available for typical gmStudio users, and we wanted to rework the samples using our scripting language, gmSL. In addition, prior releases of the samples used custom COM Interface Description Files (IDFs). The custom IDFs are a convenient way to map a COM API to its .NET replacement, but they have some disadvantages from a tooling and maintainability perspective. In this release, we are going to use Refactor files to specify mapping COM APIs to their .NET replacement. In some cases, the mappings also include instructions to load gmSL scripts that perform deep migration. The gmSL scripts that are distributed as text files with the tool and the samples and they may be extended and altered by users to meet their specific upgrade needs. Note: the COM upgrade techniques demonstrated in the samples are general capabilities that may be applied to any COM API. Additional examples of COM upgrade rules are published on the gmStudio Extensions page.


The ScanTool sample includes several COM API replacements. One of these, Scrrun to System.IO, requires a number of deep migrations:

* Replacing FileSystemObject operations with calls to static functions
* Migrating TextStream instances and calls to one of several .NET Streams based on usage

In prior releases of the sample, the Scripting to System.IO migration was done using a custom IDF and an associated gmNI DLL: GM.scrrun.dll.xml and ScrrunMigration.dll. These migration assets were activated using the following commands in the translation script:

<Registry type="libname" source="scrrun.dll" target="GM.scrrun.dll" />
<Registry type="idfstatus" source="GM.scrrun.dll" target="migrate" />

and in the custom IDF:

<Refactor id="[GM.scrrun.dll]" dllName="ScrrunMigration.dll" event="scrrun" >

Starting with the Dec-2019 Release, we are doing the Scripting to System.IO migration with a COM Refactor IDF file and an associated gmSL script: Refactor.Scrrun.dll.xml and Transform.Scrrun.gmsl. These migration assets are activated using the following command in the translation script:

<Registry type="MigFile" source="scrrun.dll" target="Refactor.scrrun.dll" />

and in the custom Refactor IDF File:

<gmSL NameSpace="scrrun" class="Transform" Source="Transform.Scrrun.gmsl" />

This change has several advantages:

  • The Refactor IDF file contains just the rules used to map Scripting to System.IO rather than intermingling the full description of the COM API with modifications to drive the migration. We believe this change makes it easier to see and modify the mappings. The Refactor IDF file works hand in hand with the standard generated IDF file making the transition from a standard to custom translation smoother.
  • The dynamic migration is done using a gmSL script rather than a pre-compiled DLL. This makes the deep migrations open to extension and modification by gmStudio users. Note: gmSL works very precisely with low-level operations in the compiled model of the VB6/COM code. gmSL can automate very difficult transformations, but the problems and solutions are in the details.

The following files are used to direct the COM migrations for the ScanTool sample:

  • Scrrun.Refactor.xml: COM API elements adjustments for scrrun.dll to System.IO and Specialized Collections.OrderedDictionary
  • Scrrun.Transform.xml: Scrrun.Transform Class implementing transformations for various scrrun.dll API references
  • Mscomctl.Refactor.xml: COM API mapping for Windows Common Controls to WinForms Controls
  • Mscomctl.ServiceMethods.gmsl: MScomCtl.ServiceMethods class implementing service extensions that alter the processing done by the core tool at specific points in the upgrade process
  • Mscomctl.MigCode.gmsl: MScomCtl.MigCode class implementing dynamic code generation logic for MScomctl API controls
  • Mscomctl.Transform.gmsl: MScomCtl.Transform class implementing transformations for various Mscomctl API references

Additional examples of these files and other COM upgrade rules are published on the gmStudio Extensions page.

Other Samples

These changes also impact the FileExplorer, FMStocks, and WPFScanTool samples.


gmStudio Release News: Thursday, 19-December-2019

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 173K LOC statistical-process-control-reporting application and major improvements to migration rules conventions. This distribution, Version 31.00, includes several enhancements:

  • Corrects fixed-size array declarations in VB.NET.
  • Improves support for implementing COM API replacements using Migrate command files and gmSL Scripts
  • Improves migration of Property.Let statements
  • Improves migration of DisplayStyleConstants and DrawModeConstants
  • Improves migration of local references to default 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:

  • Updates gmStudio with gmBasic V31.00
  • Adds support for creating generic VB6 starter codes and gmStudio projects for testing specific translation scenarios
  • Adds File/New menu as context menu to New toolbar button
  • Adds option to display Upgrade Task fields with red/yellow/green color for ERROR/WARNING/SUCCESS status
  • Adds COM IDL files as a Search Source
  • Modifies Alternate Field Layout
  • Improves highlighting Task List items
  • Improves Search Results to allow sorting of numeric columns in natural numeric order
  • Improves Visual Studio Solution File Project list to allow %UserFolder% variable in project path
  • Improves performance of pre-processing large translation scripts
  • Improves adding new tasks to a project
  • Improves Translation Log Reports
  • Improves organization of File and Help Menus
  • Improves appearance of Fonts in high DPI environments

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. This distribution includes several script enhancements:

  • Scrrun.Refactor.xml - Adds COM API mapping for scrrun.dll to System.IO and Specialized Collections.OrderedDictionry
  • Scrrun.Transform.xml - Adds Scrrun.Transform Class implementing transformations for various scrrun.dll API references
  • Mscomctl.Refactor.xml - Adds COM API mapping for Windows Common Controls to WinForms Controls
  • Mscomctl.Transform.gmsl - Adds MScomCtl.Transform class implementing transformations for various Mscomctl API references
  • Mscomctl.MigCode.gmsl — Adds MScomCtl.MigCode class implementing dynamic code generation logic for MScomctl API controls
  • Mscomctl.ServiceMethods.gmsl - Adds MScomCtl.ServiceMethods class implementing service extensions that alter the processing done by the core tool at specific points in the upgrade process
  • UserCmd.std.cmd - Improves Testing logic

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.

  • FileExplorer - Adds ListView Columns Sorting example to this sample
  • FileExplorer - Adds ListView Item Selection example to this sample
  • Batch Script - Adds logic to run Analytics Definitions Reports to the sample batch script
  • Changes to using Refactor IDF files rather than Custom IDF files for deep migrations
  • Changes to using gmSL scripts rather than gmNI DLLs for deep migrations
    Learn more on this Blog Post.

gmStudio Release News: Friday, 27-September-2019

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. This distribution, Version 30.95, includes several enhancements:

  • Adds support for dimensioned types as collection values in the GenericCollections Migration extension
  • Adds support for migrating a boolean to an enum
  • Adds support for extending an API by adding an enumeration at the library level
  • Adds support for using Refactor/Remove with Enums and Consts symbols
  • Improves default interface description files to migrate COM short to .NET integer
  • Improves support for changing the number of arguments when migrating a method
  • Corrects issue with handling arguments containing ’#’ character
  • Improves handling whitespace and complex markup when upgrading ASP
  • Improves handling name collisions between the Form and a method within the same Form
  • Improves %nP Pattern Token replacement conventions
  • Improves handling to ControlArray.Ubound operations
  • Improves handling conditional expressions comparing Date and Int(Date)
  • Improves handling division expressions using Twips quantities

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

  • Adds support for using a gmProj-specific Project List file when generating a Visual Studio Solution file
  • Adds support for specifying and using folders to organize projects when generating a Visual Studio Solution file
  • Adds Generate Solution File option to Tools Menu
  • Adds Edit Solution File Project List File option to Tools Menu
  • Adds support for passing Project Type (VB6 or ASP) into script templates
  • Adds support for PostAuthor elements in ScriptRules file
  • Improves Member Location reported in Source Scan for matches in the General code block
  • Improves displaying Functional Test Log in Information Panel
  • Improves reporting REPLACEFILE messages in Translation Log Report
  • Improves section headers in the All Logs Report
  • Improves searching Migration Set Report results
  • Improves adding multiple VBPs from a VBG file or a simple text file listing of VBP paths
  • Improves Search Results reporting to allow reporting regular expression group matching anywhere in the report record using %rec%[n] place holder in Search Report Template
  • Improves Search list results handling of “not found” case
  • Improves ScriptRules logging in the actual translation script
  • Improves the GUI Scan report with support for Designer file data
  • Improves the Side-by-Side Viewer with support for Designer file data
  • Improves References Report to include coclass/class used as parameter
  • Improves reporting Properties on References Report and Definitions Report

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 the management of complex upgrade rules and integration with the gmStudio IDE. This API was updated to reflect the latest product improvements and conventions.

  • Improves References report to include coclass/class used as parameter
  • Improves reporting properties on References Report and Definitions Report

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 Windows Common Controls to WinForms Rules
  • Implements ListControls.gmsl without using DataStore classes
  • Improves Functional Test batch processing sample
  • Improves Instructions in the Search Report Template sample
  • Adds more controls to StubControlBaseClass.xml

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 ListView Columns Sorting example to FileExplorer sample
  • Adds logic to run Analytics Definitions Reports to sample batch script

gmStudio Release News: Tuesday, 30-July-2019

gmBasic is a code transformation tool that 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. This distribution, Version 30.92, includes several enhancements:

  • Corrects problems with translating VBScript comments within ASP String Literals
  • Improves preservation of horizontal and vertical whitespace in ASP translations
  • Improves support for more operation while under trial license
  • Adds use of libtype=Internal in a migration rules file to suppress stub assembly references
  • Improves support for DataField and DataSource properties while generating a global stub framework
  • Improves recognition of various VB6 Intrinsic functions
  • Improves recognition of an custom instance of the ErrorObject
  • Simplify metalanguage information for VB6 File System ListBox controls

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

  • Adds Help/Extensions to display gmStudio Extensions Repository https://greatmigrations.atlassian.net/wiki/display/GMG/gmStudio+Extensions
  • Improves detecting and using of different versions of VS2017 for .NET build operations
  • Improves Definitions Report to indicate which subprograms are event Handlers
  • Improves ScriptRules command to allow additional script variables in FileName attribute value
  • Improves handling nested conditions in ScriptRules elements
  • Improves ScriptRules logging and error handling
  • Improves hot-key handling for Task Reset operation
  • Improves Find dialogue behavior in the Side-by-Side Form
  • Improves Translation Log Reporting
  • Improves Member named in Source Scan Report for matches found in a file’s General section
  • Improves File Peek Report when starting from first record of a file

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 the management of complex upgrade rules and integration with the gmStudio IDE. This API was updated to reflect the latest product improvements and conventions.

  • Corrects issue with WPF startup when the VB6 had a startup form
  • Improves general handling of controls for XAML generation
  • Improves Definitions Report to indicate which SubPrograms event Handlers

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.

  • Adds gmStudio Extensions Repository https://greatmigrations.atlassian.net/wiki/display/GMG/gmStudio+Extensions. Automatic Tool integration coming in a future release
  • Improves default VB6 Issues list to check for control validation handlers
  • Improves samples rules to inherit a stronger base control when generating COM stub control classes
  • Improves sample script for adding instrumentation to VB6 codes
  • Improves sample batch script for automating gmStudio from command line
  • Improves sample batch script for testing translation results
  • Improves sample migration rules for COM: MSComCtl.ocx, Scrrun.dll

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 WPF Samples to use local gmSL scripts rather than system scripts

gmStudio Release News: Monday, 17-June-2019

gmBasic is a code transformation tool that 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. This distribution, Version 30.89, includes several enhancements:

  • Improves the general ability to produce accurate, build-complete .NET (C# and VB.NET) systems from ASP sites (most recently making enhancements needed to upgrade a large e-mail marketing system with over 1000 pages and almost 300 #includes.)
  • Improves the general ability to produce accurate, build-complete .NET (C# and VB.NET) systems from VB6 applications (most recently making enhancements needed to upgrade a structural engineering application (130K LOC) and a reinsurance application (120K LOC).)
  • Adds Refactor\Fixtype@status=dynamic to allow translating with a strong type but authoring the code to use type dynamic
  • Adds Registry@type=MigFile to allow associating a Migration File with a COM interface file
  • Improves handling pages with deeply nested and inter-dependent #include files in ASP
  • Improves handling user defined VBScript class named “Collection” in ASP
  • Improves handling const in ASP
  • Improves handling arrays used in foreach
  • Improves type inference when variable is declared and initialized on same line of code
  • Improves handling to intrinsic RegExp API for ASP
  • Improves handling parameters to VB6’s file Open statement
  • Improves handling parameters to DrawMode property
  • Improves handling parameters to Scale method
  • Improves handling the Call keyword

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

  • Adds Peek Reporting mode for inspecting content surrounding a search result
  • Improves Search reporting when using a Report file as a search source
  • Improves System Configuration Search to include application templates folder as a search source
  • Improves integration of file edit operation with Search results
  • Improves integration of Side-by-Side viewer with Search results
  • Improves display of .NET files in Side-by-Side viewer when one source file becomes many .NET files
  • Improves translation log report details for warning messages
  • Improves Reference Report by reporting declaring form/control containing control references
  • Improves license checks in ScriptRules files
  • Improves accuracy of Members Report for ASP

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 the integration and management of complex upgrade rules in gmStudio. This API was updated to reflect the latest product improvements and conventions.

  • Improves Reference Report by reporting declaring form/control containing control references
  • Corrects Reference Report to avoid exception when a reference occurs in a very long source line

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 CodeScanList.txt: additional entries in preset list of Potential VB6 Issues

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.