Index | Next 

CreateObject

The CreateObject method defined in Microsoft.VisualBasic.dll fails to recognize classes that have been converted to VB.NET. To understand why this detail can impact on migrated applications, let’s suppose that you have an ActiveX EXE project named TestProject and that exposes a public class named Widget. Being a public COM class, the application can instantiate the class by means of either the New operator or the CreateObject method. (CreateObject is often used when the class name is parameterized or when you want the new object to run in a different thread.) After the migration to VB.NET, the class isn’t a COM class any longer and the canonic CreateObject function won’t work.

VB Migration Partner fixes this issue by defining a special CreateObject6 method that can instantiate both classes converted from VB6 and standard COM classes.

 

Index | Next