Page tree
Skip to end of metadata
Go to start of metadata

gmStudio can help you upgrade VB6 Collection and COM Scripting.Dictionary to strongly-typed Generic collections types  

The strongly-typed generics upgrade is an advanced upgrade feature. It is designed to be used after the standard upgrade produces correctly-typed, build-complete results. Contact Great Migrations for assistance with using this feature.

Activating the Generic Collections Upgrade

The Generic Collections upgrade is implemented as a gmNI DLL that extends the core tool.  You may activate this feature by loading this DLL with a <Select GenericCollections=on/> element or <Select RunTimeDLLS element before the Compile element in your translation script.  These elements must be placed prior to any <Reference or <Compile element.

<Select GenericCollections="on" />
OR
<Select RunTimeDlls="VbsToJvs.dll" />
...
<Compile>...</Compile>

De-Activating the Generic Collections Upgrade

<Select GenericCollections="on" />
OR
<Select RunTimeDlls="VbsToJvs.dll" />
...
<Compile>...</Compile>
...
<Collections Collection="off" Dictionary="off" /> 

Reporting the Generic Collections Upgrade Activity

  • To write generic collection type inference activity to a file add 

    <Collections Report="<filepath>">
  • To write generic collection type inference activity to the translation log add 

    <Collections Report="on">

The report will contain DictionaryAdd and CollectionAdd statements that you can analyse and manually modify then include in your translation script to optimize the upgrade process.

Optimizing the Generic Collections Upgrade

The DictionaryAdd scripting command placed after <Compile> and before <Analyse> allows the user to specify how a Scripting.Dictionary in the source should be upgraded to a generic collection or dictionary in the generated code. 

<DictionaryAdd identifier="FullName" Key="KeyType" Item="ItemType" />

The DictionaryAdd script command has three attributes as follows:

Attribute Description
IdentifierSpecifies the fully qualified name of a dictionary component in the source project.
KeySpecifies the key type for the dictionary. Must use type names from the source platform.
ItemIf present, specifies the item type for the dictionary. Must use type names from the source platform.

If the identifier cannot be located, then the command is simply ignored

The CollectionAdd scripting command placed after <Compile> and before <Analyse> allows the user to specify how a VB6.Collection in the source should be upgraded to a generic collection or dictionary in the generated code. 

<CollectionAdd identifier="FullName" Key="KeyType" Item="ItemType" Ordered="on|off"/>
...
<Analyse />

The CollectionAdd script command has four attributes as follows:

Attribute Description
IdentifierSpecifies the fully qualified name of a collection component in the source project.
KeySpecifies the key type for the dictionary.  Must use type names from the source platform.
ItemIf present, specifies the item type for the dictionary. Must use type names from the source platform
OrderedIf set to on, specifies the target type is an OrderedDictionary

If the identifier cannot be located, then the command is simply ignored.




  • No labels