vb6visual-studio-2022legacy

Creating a Visual Basic 6 project from existing code in Visual Studio 2022 results in millions of compilation errors


Trying to do this on Windows 10.

I have a VB6 folder and I'm trying to make a solution out of it.

Visual Studio succeeds in making a project, but when trying to compile it gives millions of errors (see image).

visual studio vb6 errors

I've read conflicting info about VB6 support in Visual Studio. On one hand it's written that Visual Basic is supported, but not VB6? There also used to be a VB6 IDE, but I can not find a download for it.

Should I use Visual Studio 2008 or something?

What are my options?

Thank you.


Solution

  • When Microsoft today uses the abbreviation "VB", they usually mean "VB.NET", the successor of classic VB published by Microsoft in 2002. According to this source, the latest version of classic VB, called VB6, appeared in 1998, and 10 years later Microsoft dropped any support for VB6 and its IDE.

    Unfortunately, VB.NET is not backwards compatible to VB6, it is a different programming language (though it has some properties which arguably make it easier to port VB6 code to VB.NET than to other .Net languages like C#). You cannot compile VB6 programs directly with Visual Studio 2002 or later, you usually need the original VB6 IDE. That leaves you basically with two options:

    Note also when your old VB6 code uses 32-bit third party OCX/ActiveX components, for porting it to VB.Net I would recommend to use VS2019 or an earlier version, not VS2022. The current Winforms Designer of VS2022 is not compatible with 32 bit OCX components any more, and it is unclear if MS will ever publish a version which will be.