none
How to migrate OCX components RRS feed

  • Question

  • Hello,

    I've managed to migrate an application from VB4 to VB.NET using the wizard of the Visual Basic 2008 Express Edition. The migration took place in a Windows XP Virtual Machine where VB4, VB6 and VB 2008 Express Edition are installed. The migration path was VB4->VB6->VB 2008 Express Edition. 

    The wizard retained components such as the MSGrid by adding COM references:

    1. Microsoft DAO 2.5/3.51 Compatibility Library COM version 3.5.0.0 (Path = [..]\Interop.DAO.dll)

    2. Microsoft Grid Control COM version 1.0.0.0 (Path = [...]\AxInterop.MSGrid.dll)

    3. Sheridan 3d Controls COM version 1.0.0.0 (Path = [...]\AxInterop.Threed.dll)

    The problem is that I cannot build the VB.NET project with Visual Studio 2019 in Windows 10. At first, all three references (AxMSGrid, AxThreed, DAO) were shown with a yellow warning icon in solution explorer. The icon disappeared for AxMSGrid and AxThreed after I registered GRID32.OCX and THREED32.OCX (using regsvr32) but I still get the following errors when I build the project:

    "Could not resolve COM reference a8b3b723-0b5a-101b-b22e-00aa0037b2fc version 1.0. Object reference not set to an instance of an object."

    "Could not resolve COM reference 0ba686c6-f7d3-101a-993e-0000c0ef6f5e version 1.0. Object reference not set to an instance of an object."

    As far as I can tell, both those GUIDs refer to AxMSGrid and AxThreed while as I said, those references look OK in the solution explorer. 

    So, I don't quite understand what the problem really is and what to do next. Of course, I algo get a warning (not an error) about the DAO reference which I don't why it's even used since there is no database used in the application whatsoever.

    How can I have the project built in VS 2019 on Windows 10?

    any ideas?


    dimpant

    Friday, January 10, 2020 11:28 AM

All replies

  • Hello,

    First off the yellow triangle indicates that item will not work at all in Visual Studio, similar to attempting to create a windows form project using .NET Framework 4.7.2 and a reference class project with .NET Framework 3.5, both projects need to use the same Framework version or create a .NET standard project to interface between the two projects which knows how to handle dependencies which is usually done via a NuGet package.

    Many, many years ago we attempted a similar conversion using similar controls and even after we could compile the components failed to work properly, also under properties of older VB classic components not all properties could be edited as the underling interfaces were not supported in current Visual Studio and surely not going to work in VS2019.

    Best to discard the idea of a conversion and create a new project and write in the style of VB.NET rather than in the style of VB classic (which you are coming from).

    There are also paid services (which I would avoid unless it's a very last resort), this one offers a free analyzer 


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange


    Friday, January 10, 2020 11:39 AM
    Moderator
  • With the transition from Win32 OCX to .Net (around 2002) there was created a so called .Net WindowsVB6Compatible namespace. (Which is not the .NetVisualBasic namespace.)


    That VB6 compatible namespace contained parts which were even worse reliable than for instance the VB6 OCX flexgrid.

    Direct was written to use it temporally because it would soon be removed. That 'soon' was more than 10 years. But currently 2 decades after the end of Com in Visual Basic it is for me really strange to ask why it is not going anymore.


    Yea what to advice. The advice is already given 20 years to realise that the compatible namespace is a temporally solution. If you don't follow that, then probably any advice is senseless.    


    Success
    Cor

    Friday, January 10, 2020 2:21 PM
  • Hi,

    If the project is not large, it is recommended that you learn VB.NET and rewrite the project. If you still want to use it now, you can keep it in VB4.

    Karen and Cor Ligthert have explained to you very clearly, I hope that helps you.

    Best Regards,

    Julie


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, January 13, 2020 1:58 AM
    Moderator