Resources

VB6 vs VB.NET language - External objects


Unless otherwise stated, VB Migration Partner fully supports all the Visual Basic 6 features and keywords mentioned in this page. For more information, please read the manual and the knowledge base section.





External objects

Binding and BindingCollection

These two VB6 objects are defined in the Microsoft Data Binding Collection type library (MSBIND.DLL). The Upgrade Wizard converts them using the MBinding and MBindingCollection types in the Microsoft.VisualBasic.Compatibility.Data assembly.

VB Migration Partner converts these objects using the VB6Binding and VB6BindingCollection types, defined in VB Migration Partner’s support library. No dependency from the Microsoft.VisualBasic.Compatibility.Data assembly is necessary.

Dictionary

The Dictionary object is defined in the Scripting type library (SCRRUN.DLL) and is often used by VB6 developers as an high-speed alternative to the Collection object. The Upgrade Wizard doesn’t convert this object and leaves a reference to the original COM type library.

If you want to get rid of all dependencies from COM objects you should convert this object using the System.Collections.HashTable object. Even better, if all items of the dictionary of same type, you can convert it to System.Collections.Generic.Dictionary(Of T) type and achieve better performance and type safety.

VB Migration Partner converts Dictionary objects using the VB6Dictionary type, defined in VB Migration Partner’s support library. All members are fully supported.

FileSystemObject

The FileSystemObject type and its ancillary types - e.g. Drive, Folder, File, TextFile, etc. - are defined in the Scripting type library (SCRRUN.DLL) and are often used by VB6 developers to manipulate files and folders. The Upgrade Wizard doesn’t convert this object and leaves a reference to the original COM type library.

If you want to get rid of all dependencies from COM objects you should convert this object using the types defined in the System.IO namespace, for example DriveInfo, DirectoryInfo, and FileInfo. However, there are many subtle differences between the original COM objects and their closest counterparts in the .NET Framework. Just to mention one, the File.Copy method works both in COM and .NET, however only the COM version can handle wildcards.

VB Migration Partner converts the FileSystemObject type and its ancillary objects by mapping them to types defined in VB Migration Partner’s support library. All members are supported and all COM dependencies are removed, yet functional equivalence with the original code is fully preserved.

ObjectContext and SecurityProperty

The ObjectContext and SecurityProperty objects are the most important classes defined in the COM+ Services Type Library (COMSVCS.DLL) and are used by VB6 developers when building COM+ applications.

The Upgrade Wizard correctly migrates COM+ classes into .NET types that inherit from System.EnterpriseServices.ServicedComponent and that are marked with an appropriate Transaction attribute. References to the ObjectContext type are migrated as instances of the System.EnterpriseServices.ContextUtils helper class, which exposes methods such as SetAbort, SetComplete, etc. Not all members are supported, though.

VB Migration Partner fully supports the ObjectContext and SecurityProperty objects, which are converted using types defined in VB Migration Partner’s support library. All members are supported. Notice that only these two classes are converted into native .NET objects; if the application uses other classes in the COMSVCS type library, a reference to this COM library is added to the migrated VB.NET project.

RegExp

The RegExp type and its ancillary objects - namely MatchCollection, Match, and SubMatches - are defined in the VBScript type library (VBSCRIPT.DLL) and are sometimes used by VB6 developers to regular expressions. The Upgrade Wizard doesn’t convert this object and leaves a reference to the original COM type library.

If you want to get rid of all dependencies from COM objects you should convert this object using the types defined in the System.Text.RegularExpressions namespace. However, the correspondence between the COM and the .NET types isn’t perfect and you must be account for minor adjustments in code. For example, regular expressions options are expressed as properties in the COM version (e.g. MultiLine, IgnoreCase), whereas they are specified as method arguments in the .NET version.

VB Migration Partner fully supports the RegExp types and related objects, and maps them to fully managed classes defined in VB Migration Partner’s support library. All members are supported and all COM dependencies are removed, yet functional equivalence with the original code is fully preserved.

StdDataFormat and StdDataFormats

The StdDataFormat object and the StdDataFormats collection are defined in the Microsoft Data Formatting Object Library (MSSTDFMT.DLL) and are used by VB6 developers in conjunction with data binding. The Upgrade Wizard maps these objects to types in the Microsoft.StdFormat assembly. This is basically the Primary Interop Assembly (PIA) of the original COM library, hence a degree of dependence from COM still exists in converted .NET applications.

VB Migration Partner converts these objects using the VB6DataFormat and VB6DataFormats types, defined in VB Migration Partner’s support library. These types supports all the members of the VB6 objects and preserve functional equivalence and allow you to get rid of all COM dependencies at the same time.







Follow Francesco Balena on VB6 migration’s group on

LinkedIn





Read Microsoft Corp’s official case study of a VB6 conversion using VB Migration Partner.




Code Architects and its partners offers remote and onsite migration services.

More details




Subscribe to our free newsletter for useful VB6 migration tips and techniques.

newsletter



To learn more about your VB6 applications, run VB6 Analyzer on your source code and send us the generated text file. You will receive a detailed report about your VB6 applications and how VB Migration Partner can help you to quickly and effectively migrate it to .NET.

Get free advice



A fully-working, time-limited Trial Edition of VB Migration Partner allows you to test it against your actual code

Get the Trial




The price of VB Migration Partner depends on the size of the VB6 application, the type of license, and other factors

Request a quote




Migrating a VB6 application in 10 easy steps

Comparing VB Migration Partner with Upgrade Wizard

Migration tools: Feature Comparison Table

All whitepapers