Time to Mobilize
- Application Migration
- Database Migration
Components provide reusable code in the form of objects. A VB6 application that uses a component’s code, by creating objects and calling their properties and methods, is referred to as a client. And the DLL that exposes those components is referred as the server.
Components can run either in-process or out-of-process with respect to the clients that use their objects. An in-process component, or ActiveX DLL, runs in another application’s process. The client may be the application itself, or another in-process component that the application is using.
In-process components are used by applications or other in-process components
An ActiveX DLL usually define classes and these classes can have different instancing settings:
The VBUC will identify if your project is an ActiveX DLL. In your solution list it will mark its type as OleDll and the Reference Guid is the Guid that is used in other projects to reference this ActiveX DLL.
The VBUC provides at least 3 migration options:
The VBUC converts Visual Basic 6 ActiveX Dlls to .Net assemblies. By default the resulting .Net assemblies can be used only from managed code. If it is necessary use to these assemblies from non-managed code, this option should be selected in order to generate the .Net attributes required to expose these assemblies as COM Objects. For example: [ComVisible(true)].
In addition to the ComVisible attribute for the assembly members, the .Net project is also marked as a COM Visible.
The exposed classed will also have the necessary COM attributes added. For a source code example see here
This optional feature enables the conversion of ActiveX DLL/EXEs (with global variables) via a helper class (ComponentClassServer) that controls the instantiation of the generated class libraries.
ActiveX DLLs are converted to .Net using application domains and the instantiation of the components is archived using helper classes.
With this approach most of the ActiveX functionality is replicated in the converted code. For more details and sample code click here.
Converts ActiveX DLL/ and ActiveX EXEs to standard .Net assemblies (class library projects).
All ActiveX are converted to native .Net assemblies.
With this approach the converted code can be use only from manage code and the different VB6 ActiveX instantiation models (e.g MultiUse, GlobalMultiuse, etc) won’t be supported.
The VBUC converts Visual Basic 6 ActiveX EXEs ActiveX DLL to standard .Net assemblies (class library projects).
One of the main differences between VB6 ActiveX and .NET assemblies is the way of how the component is instantiated (e.g MultiUse, GlobalMultiuse, etc). This initialization determines the lifetime behavior for the component. With this option the code is converted using pure .NET code and the VB6 ActiveX instantiation models won’t be supported.