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

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).
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.

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 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 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:
Try to find a copy of the old VB6 IDE and compile the program with it (if you cannot get it from where you got the source code, according to the comments, you may have luck at Microsoft, when you have the right developer subscription level).
Port the VB6 application to VB.Net. For this, however, you should have some not-too-basic knowledge of both languages, know the differences and ideally have an environment where you can test the original application against the ported one. I did this by myself in the past for some applications, so I know it can be less effort than recreating an application completely from scratch. However, this depends a lot on the specific application, how large and complex it is, how large the UI parts are and which kind of 3rd party components were involved. To be honest, if the application is not trivial, you should have a VB6 IDE for this approach, too.
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.

Related

tools available to run a vb 6 projects?

i have a vb 6 prroject itried to open it on vs 2013 by installing extension name as vb 6 for visual studio from console manager now i the error is that extension is not compatible so i google that its mean vb 6 project cannot be upgraded so instead of wasting time i am asking is there any tool to run vb 6 win form gui app so that i can open my source code , can you give me that downloading link of tool too
i have extension frm , with my forms in vb 6 so please
as vb 6 is not a part of .net technology so it will never run on visual studio
Simple answer: VB6 is long past end of life from Microsoft.
None of Microsoft's existing tools will even read VB6 sensibly. VB.net is NOT VB6 in any way or form.
If you want to develop/enhance/extend a VB6 program, you need a VB6 development environment. Some say this is available via MSDN. Otherwise it is pretty hard to find.
As a practical matter, if you want to move this VB6 program to a modern language, you'll need to find a migration tool/vendor/service that understands VB6 to do this for you, or do it yourself (which usually fails unless the project is really small). And yes, converting the forms is hard.
Even if you fork over the cash for an MSDN subscription to get access to the necessary tools it takes time to develop proficiency in a new language and those tools for using it. Many companies take the smarter path and hire a contractor with both the tools and the experience to handle maintenance of their legacy VB6 portfolio.
This saves the expense of porting such applications to another language and limits the risk of such a port having data-destroying flaws.
You could use VS2008, but you'll probably still have a lot of work to do.
Depending on what you need this VB6 code for, you might be able to copy it into the VBA (Visual Basic for Applications) section of a Microsoft Office document. As I understand it, VBA is nearly identical to VB6 from a programming-language and capability point of view.
Note that this would not allow you to compile code to a standalone EXE or DLL, but if you don't need to do that it might be an acceptable workaround for not having the VB6 development tools.
Here is a link to Microsoft's primer on VBA: MSDN VBA Primer.
Also, be aware that most VB6 source code files (excepting FRX files) are plain text so if you just need to read them, you can use any text editor.

Options for Development of Win32/MFC Applications

I'm still using Visual C++ 2003 to maintain and enhance a PC-based program. It is written in C & C++ and just runs on the PC -- not on the web, a phone, in the cloud, or whatever -- and I have no idea what this .NET framework is all about and probably don't need to care at this time.
Anyway, now that I've upgraded my development PC to Windows 7 it's getting more inconvenient to run the old development environments. I think that the latest full version of Visual Studio 2010 would still work to build my project, but the cost is really off-putting. At least in 2003 they offered Visual C++ by itself for around $100, but the freebie Visual C++ .NET 2010 would do me no good at all.
So are there any alternatives to Visual Studio Pro out there these days? I'd even be willing to rewrite the stuff that actually depends on MFC if I can find something to replace it (and still have access to all the Win32 and early C library support).
Why not pick up a second hand copy of Visual Studio 2005 or 2008 on e-bay?
PS: I always considered VS2003 a really bad IDE when compared to VS2005 and VS2008.
Code::Blocks
Eclipse
Dev-C++
You could use Visual Studio 2010 Express if you would replace all MFC-stuff with pure Win32-calls or with another windowing library like Qt, Fox, eGUI, Tk ...
How much GUI is your application? If it's mostly a algorithms and data classes, rewriting the GUI in C++ might make sense. If it's mostly dialogs and lists, rewriting it on the .net-platform would be much faster.
If you are willing to rewrite the stuff that depends on MFC, then you have many options, but I will suggest these two:
Gtk+ - if you want to develop everything using C. If you like c++ then you have c++ bindings gtkmm
Qt - this is a c++ framework which comes with complete development tools too.
I think the free version of Visual Studio Express can still compile plain old C++ without the .NET. The only problems are that it doesn't include MFC or a resource editor. You might be able to use the MFC include files and libraries from your Visual Studio 2003, but I don't know what you would do for resource editing.
wxWidgets is similar enough to MFC that you might pick it up very quickly. The biggest difference is how you lay out dialogs.

Java IDEs vs Microsoft IDEs

I come from a strong Java background and in recent years have been also developing in C#.
What I can never understand is how far behind (Personal Opinion) the Visual Studio IDE's are in compared with Intelli-J IDEA and Eclipse (Java).
There have been improvements by Microsoft from VS 2005 to VS 2008, but I feel they are not quite there in terms of taking the development experience to the next level.
What I want to know is, is VS 2010 any different?
Why is it that the tools and syntax editors are so much more "evolved" in the Java IDE's.
Just to name a few:
Code Completion (Much more advance in Java IDE's)
Ant Integration (Eclipse and IDEA) vs Visual Studio Build Events
Lack of Code Repository integration in VS (Subversion and CVS) out of the box.
Lack of Advance Re-factoring Tools in Visual Studio.
Thanks.
A few points…
People tend to like what they know.
It is quicker to get up-to-speed in C# as the IDE and most of the tools / docs come from a single source.
In the Java world you have a lot more chooses, this is great for expert that spend times learning about them all, but does also lead to its own problems.
Adding ReSharper or Refactor to Visual Studio may give you what you want.
The Visual Studio debugging is great.
Visual Studio tries to make life easy for you by trying to find missing dlls etc and then storing where they are in the registry. This may be great for a 1 man project, but can often lead to build problems across developer’s machines if you are not careful. In the Java world you have to edit more config file by hand, but at least you can put these files under source code control.
There is not a small command line tool that works well on a build server that will build all types of Visual Studio projects. However in day to day usage you don’t need to learn how to use command tools, as Visual Studio hides them form you.
I think these days most programmers
are just happier with the IDE they
know best.
Note I wrote this over 6 years ago, since then C#/.Net has got a lot more complex, with lots of open source projects. Microsoft has also open sourced a lot of the .net framework. For web and server side development I expect there is now little to choose between the Java world and the .Net world. For “smart clients” .net still have a lot to offer including the new support from cross device phone development.
For multi-threaded IO, I think c# is years ahead of Java, but that could change as C# and Java keeps learning from each other...
Visual Studio has definitely been coming on over the last few years - although many of the improvements have basically been things that Eclipse has had for ages (I haven't used IDEA myself).
You may well want to look at ReSharper, which brings more goodness to Visual Studio, along with the VS2010 Productivity PowerTools.
Also, have a look at Scott Guthrie's blog series about improvements in VS2010. Lots of goodies in there.
All tools have their strengths and weaknesses - these days I'm about as happy in Visual Studio as in Eclipse... although I'm much happier writing C# than Java :) One area where Visual Studio really shines is debugging though... I find things like the VS Watch window to be much better than Eclipse's equivalent.
Visual studio 2017 is still far far behind Intellij IDEA. I'm using both and i can say that even VS2017 with ReSharper is not comparable with IDEA.
Biggest problem for me is that VS still doesn't offer usable hot reload debugging experience. I'm crying every time i have to rebuild my .NET MVC project (it is +- fast, but IIS Express load time ~ 15s EVERY time you make even the smallest change in your code).
If you want to argue with "Edit and continue" so so hotreload function - it is absolutely useless, you can't do almost any change in code without rebuilding (and everytime you have to manually break code and close opened tab with useless information).
So i'm really looking forward for full version of IntelliJ Rider bringing all super user friendly possibilities of IntelliJ IDEA to the .NET world!
I don't agree with you. I think VS is much more easy to use.
For example, when i need to create a web application. I open VS and create a new project (Web Application). After the project created, i press f5 and tadda!...
But if want to create my web application with Java, i need to install a server or some frameworks. Still i don't know how can i create a web application?
Or, Windows Application.
At VS, you don't need do any thing to create a windows based application like web application. but if i want to create windows based application with Java, i had to do something.
I think VS IDE is more user friendly than Java IDE's.

What to do if I don't have Visual Basic 6.0 and need to compile a VB6 project?

A client wants me to do some maintenance work to a VB 6.0 application (migration to .NET is also in the pipeline), but he doesn't have the development tools because he received just the source code and running application from the original programmer, who is no longer available.
Microsoft doesn't sell Visual Studio 6.0, as far as I know. How can I modify and compile the source code for a VB6 application without VB6? or Where do I get Visual Studio 6.0 if Microsoft is not selling it?.
Even if I migrate everything to .NET without releasing a new VB6 version, I would like to be able to open the project and see it compile and run to better understand it.
I have VS 2005 and VB 2008. But I understand that if I try to open the project the code will be converted to VB.NET and that's not what I would want before getting to know the project better.
From what I recall the Visual Studio 6.0 is available for MSDN Subscribers.
Hunt Ebay or Craigslist. Or call your regular software vendor, I'm sure they can still get it for this sort of reason.
Visual Basic 5 Control Creation Edition might be suitable to tide you over until you can get hold of a full version of VB6. There are limitations and it is 5 not 6, but depending on the scope and complexity of the application it might work for you as an interim measure.
Many textbooks on Visual Basic 6 frequently included a fairly usable version if VB (I can't recall the exact name offhand, perhaps VB 6 student edition?) that allowed the compiling of .exe files. VB 5 textbooks usually bundled VB 5 CCE, VB 4 books bundled VB 4 WM, neither of these are suitable replacements for a production VB 6 app IMHO, especially their lack of ability to create .exe files.
I will say, Visual Studio 2005 (VB 8) converted VB 6 apps quite well if that's an acceptable interim solution (which it may not be given the requirement for the large .NET 2.0 runtimes).
To get a feel of the code, you could try to compile parts of the application in MS Office / VBA.
Of course, this will only offer limited functionality, but may suffice for some testing.
Both Amazon and eBay currently have copies for sale (although they seem a tad expensive but this would be a pass-through cost to your customer so it's up to them whether they pay this).
You may want to check out the licence for VB.net; it may allow you to run previous versions of the software, such as VB6 (though you'd still have to source the actual media to install it, of course).
The MSDN "Visual Studio 2008 Professional with MSDN Professional" has previous version of Visual Studio tools but it comes in at USD1200 so, if you just want VB6, eBay is the better option.
Keep in mind that MSDN pack has all the Visual Studio languages and VS6 through to VS2008 so it's probably got everything you need.

VS2010 Extensibility - how different is it?

A question to those of you who already looked at VS2010. How big are the changes that add-in developers will have to make in order to get their add-ins working under VS2010?
As luck would have it I've just written about this exact subject and shown what it took to upgrade my add-in. (links below)
Basically your answer is that there is a low-impact migration, because a back-wards compatible "shim" is in place for most functionality. Understandably though, to get the new stuff in 2010 like MAF, MEF, and WPF there will be some work on the developers part.
http://jb-brown.blogspot.com/2008/11/migrating-visual-studio-add-in-to-2010.html
http://jb-brown.blogspot.com/2008/11/migrating-visual-studio-add-in-to-2010_29.html
(more to come)
Lastly - Be sure to read this outstanding post from Carlos Quintero, MVP about Add-Ins, Frameworks and CLR compatibility. Carlos's blog is the best I've found for add-in stuff.
We've already migrated a development version of our Visual Lint product to VS2010, and for the most part the migration was straightforward - or would have been if there weren't so many bugs in the Visual Studio 2010 Beta 1 automation model. The experience has been akin to the work we had to do to support VS2005 (by contrast VS2008 was a breeze), so it's obvious that VS2010 represents a major change in the evolution of Visual Studio.
As we're using the same binary for all versions of Visual Studio we support (which means the code is contstained to be native C++ throughout), breaking changes in the interfaces tend to be quite visible to us. This time, the areas which have caused us issues are:
The new .vcxproj project file format (we parse project files to read project properties as that's more reliable across multiple Visual Studio versions than using VCProjectEngine - the Visual C++ automation model). Hence we had to write a new parser for .vcxproj files, and as they are potentially very complex that was a major task in itself.
Various bugs in the command bar/command interfaces (presumably related to the new WPF editor/command bar integration). Carlos Quintero has blogged extensively about this subject, so if you have concerns in this area you would be well advised to read his blog.
An undocumented change to the add-in startup sequence in Beta 1 which meant that the DTE Window interfaces were not functional until the OnStartupComplete event had occured. MS have informed us that they are reversing this particular change in Beta 2 due to potential compatibility issues, but we've desensitised our code to this one now, anyway.
Toolwindows in Beta 1 can't be created by internal CLSID (though ProgID works OK). This is the last one we're waiting on before we can wrap up the last major bit of the port.
I suspect that our experience will be pretty representative for most add-ins - it is only if you are using the areas affected directly by major changes in Visual Studio itself (e.g. editor or intellisense integration) that the effects are likely to be particularly severe.
Finally, we're not planning to migrate the build itself to VS2010; it is currently built in VS2008, and we quite simply can't see any reason to migrate to an IDE which is showing every sign of still being a "work in progress" even when it RTMs later this year (that's just my personal opinion though - YMMV).

Resources