gmStudio Extensions
- Mark Juras
gmStudio's code analysis and translation capabilities may be extended and modified through various rules files and scripts. These custom transformation are specified using various types of configuration files that extend and modify the definitions of language and API elements and also allow activating dynamic translation rules. This page contains samples of these configuration files. The concepts and techniques for creating and using these customizations are described in other articles:
You can see this technology in action by downloading examining our Samples.
A collection of sample rules files and script is cataloged here; you may download these and experiment with them in your environment.  You may visit the full list of gmStudio Extension files in the attachments to this page.  Please Contact Us or post your questions here.
API Migration Rules Files (RefactorLibraries)
Migration Rules Files (RefactorLibrary Files) are the preferred means of mapping a COM API to its replacement in .NET. Â
Best practice is to load an API Migration Rules file using a registry-migfile command, however they can be loaded by convention when by naming the migration file mig.libfile.xml (for example mig.scrrun.dll.xml will be loaded automatically for codes that references scrrun.dll.xml).  The file mig.vb7lang.xml is a special case: it may be used to modify the mapping of VB6/ASP language elements to .NET.Â
The recommended naming convention for these files is libfile.[target].Refactor.xml where libfile is the name of the type library (e.g. scrrun.dll) \[target] is a user-defined descriptive name. For example scrrun.dll.SystemIO.Refactor.xml contains rules for migrating scrrun.dll (Scripting Runtime) to System.IO. Which may be activated with a registry command.
<registry type="MigFile" source="scrrun.dll" target="scrrun.dll.SystemIO.Refactor" />
or
<registry type="MigFile" source="scrrun.dll" target="..\usr\scrrun.dll.SystemIO.Refactor.xml" />
Note: the first example above uses Metalanguage file path resolution and will look through the metalanguage folders for a .XML file. The second example uses an actual file path specification relative to the working folder.
Custom Interface Description Files (IDFs)
Custom IDFs allow you to migrate COM APIs to .NET replacements. This is a powerful and fairly intuitive technique, but it is not as maintainable as Migration Rules files.Â
The gmStudio samples use custom IDFs files, but this approach will be phased out in favor of using Migration Rules files. See Custom COM Replacement.