Previous | Index | Next 

[INFO] Converted .NET applications target 32-bit CPUs by default

By default, VB Migration Partner creates .NET applications that target the 32-bit platform. This setting is necessary because it ensures that the application works correctly even if it uses one or more 32-bit ActiveX controls – including the wrapped ActiveX controls included in CodeArchitects.VBLibraryOCX.dll or those created by the AxWrapperGen tool.

Notice that the VB6Library DLL has been compiled with the “AnyCPU” option and can therefore work with both 32- and 64-bit applications. However, this DLL fails if you use one of the ActiveX controls that it wraps, namely INet, MAPIMessages, MAPISession, MSComm, ScriptControl, and Winsock.

If you are sure that your VB6 application doesn’t rely on any ActiveX control – either wrapped or not – you can enable the “AnyCPU” option for the converted .NET application in the Advanced Compiler Settings dialog box, which you reach from the Compiler page in the My Project designer (if converting to .NET) or in the Build page (if converting to C#).

If you mistakenly use the AnyCpu setting for an application that runs on a 64-bit platform, then the application will crash with the following error:

    An error occurred creating the form. See Exception.InnerException for details.  
    The error is: Retrieving the COM class factory for component with CLSID {...} 
    failed due to the following error: 80040154.

where the actual CLSID is the identifier of the ActiveX control that the application attempted to create.



Previous | Index | Next