Overview
Upgrading a real-world VB6 application typically requires replacing COM APIs with .NET APIs. gmStudio uses and open, extensible COM type system to facilitate automating these types of COM upgrades. The COM type system used by the upgrade process is declared in a set of files called Interface Description Files (IDFs). IDFs are XML text files that declare all of the elements of an API: the enumerations, classes, structs, etc. IDFs are detailed dow the level of individual method arguments. An standard set of IDFs are generated for you by gmStudio from the COM binaries used by your application. The IDF generation process usually works completely automatically, but in some cases it is necessary to manually locate and generate IDFs for atypical COM type libraries.
...
This document describes how to use the second approach. See this article for a discussion of COM Replacements by modifying IDFs directly.
Mig.IDF Files
A Mig.IDF file is an XML text file that contains refactoring commands associated with a given IDF. Using Mig.IDF files provides a more deliberate, and arguably superior approach to organizing COM migration rules for each API. Compared to COM replacements done by modifying IDFs directly, using Mig.IDF files can be easier to create and easier to see what is being migrated because the rules are more clearly identified and explicit. Note also that Mig files are applied to the generated IDF, so re-generating the IDF will not disturb the associated Mig.IDF file.
An Example: MSComCtlLib.ProgressBar to a WinForms.ProgressBar
Let's say you want to migrate MSComCtlLib.ProgressBar to a WinForms.ProgressBar. This is a pretty easy migration as the WinForms control is very similar to the COM control.
...
Code Block |
---|
<RefactorLibrary> <Refactor id="[MSComCtl.ocx]"> <Migrate location="DoNotDeclare" migName="System.Windows.Forms" /> <Migrate id="IProgressBar.Min" migName="Minimum" /> <Migrate id="IProgressBar.Max" migName="Maximum" /> <Migrate id="IProgressBar.Appearance" migStatus="mustCorrect" /> <migClass id="NetControl.ProgressBar" migName="System.Windows.Forms.ProgressBar" parent="ProgressBar"> <property id="Location" value="(Left,Top)" nPram="2" migPattern="new System.Drawing.Point(%1d, %2d)" /> <property id="Name" type="string" value="SYM.name" /> <property id="Size" value="(Width,Height)" nPram="2" migPattern="new System.Drawing.Size(%1d, %2d)" /> <property id="TabIndex" type="Integer" value="TabIndex" default="0" /> <!-- NOT MAPPED for designer Appearance = System.Windows.Forms.AppearanceConstants.cc3D; --> </migClass> </Refactor> </RefactorLibrary> |
The Mig.IDF file should be placed in "user" folder in the project work space along with the other upgrade scripts, code, and documentation you are developing for your upgrade solution.
...