Improve company productivity with a Business Account.Sign Up


upgrade vb6 project with several dependancies to

Posted on 2013-06-09
Medium Priority
Last Modified: 2013-07-08
I have a project in vb 6 that has 5 dependencies

each is also a vb6 project.

I need to upgrade everything to

do I combine all into 1 project?

what is the best approach
Question by:hainansyndrome
LVL 10

Expert Comment

by:Asim Nazir
ID: 39233987

Try the upgrade solutions. Download and install this analyzer tool.

Go through this article for a detailed conversion strategy.
LVL 40

Accepted Solution

Jacques Bourgeois (James Burger) earned 380 total points
ID: 39234713
Coming from 12 years of prior experience with VB6 and having now the same 12 years of experience with .NET, I can tell you that the best approach is to start from scratch in .NET.

Although VB6 and VB.NET have the same syntax, too many things are different to make conversion a good solution, unless you have a very simple project, which does not seem to be your case. .NET applications are not designed the same way. How you work with errors and databinding is very different. Many little things have no direct equivalent and need to be rewritten anyway. And a conversion does not use the extra possibilities of .NET, so you basically ends up with no gain at all. On the contrary, you end up with a buggy application that is most of the time slower than the original.

Most "real" projects I have seen converted through the converter ended up on the scratch pile after a few days, weeks or even a few months. And I am not talking about my own conversion projects, because I understood that after the first try. It comes from the hundreds of programmers that I meet each year in the VB.NET training sessions I give.

The result of a conversion is always a mess of code that no programmer would ever write. Experienced .NET programmers have often problems understanding that code because it does strange tricks in order to give in .NET the same result as it did in VB6. VB6 programmers think that they can learn from the generated .NET code, but you will learn nothing, because that is .NET code that emulates VB6, not true .NET code. Half of what it does is done through a Compatibility library that nobody uses when writing straight in .NET.

That code is buggy and hard to debugged because it is not clean .NET code. Not only will it be a pain to make the conversion work, but it will be a pain to maintain for as long as the application will be in use.

If your 5 dependencies are dlls for which you have the source code, you might have a way to go. Otherwise you will gain much by starting everything over in .NET. More work at first, but in the long run, it will pay with a more robust application that is easier to maintain, and you will learn to work properly in .NET.

You can start by rewriting only the application from scratch in .NET, and still use the dependencies as they are now. .NET can often work quite well with old dlls, unless they used the Variant datatype extensively. The Variant is no longer supported in .NET, and dlls that use them a lot usually do not work well with .NET applications.

Then, as the needs arise, rewrite each dependency in .NET, one by one.

Author Comment

ID: 39234950
The dependencies are DLL's
I just inherited this thing and although I will be rewriting this a lot I simply do not have the bandwidth to rewrite from scratch.
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

LVL 40
ID: 39235039
I suggest that you try running the converter on the main application. All you have to do is open the VB6 project in Visual Studio. This will give you a report of the things that need to be corrected. That will give you an idea of the amount of job you will still have to do after the conversion. Sure, this is something hard to evaluate if you do not have much experience in .NET, but it might help you figuring out if a conversion or a rewrite is the way to go.

And remember that a conversion might eventually work, but will be a mess that will be hard to maintain in the log run.

I understand that you do not have the source code for the dlls and cannot convert them to .NET. As I said before, they might work easily well the .NET application, but maybe not. It depends on how they were designed and the types they use. I would contact the providers to know if they have .NET versions or interop available for their COM dlls.

An interop is a bridge between .NET and COM and is something that you will need anyway. One will be created on the fly for you when you reference a COM dll in a .NET project. But these on the fly interops sometimes do not work well, so some vendors provide an interop that has been debugged and enables you to use the old dlls without problems.

Author Comment

ID: 39235051

all the dll's were written in vb6 by the original author, I have their projects.
Should I try to combine all the projects into 1 project?
LVL 40
ID: 39235220
I would not try to combine them. There were probably reasons why the thing was develop in 6 parts instead of one big project.

And since you can first convert the application and test it with the old dlls, you will be able to see sooner if converting is a viable solution. If you do everything at once, it may takes you weeks before you have something that can run, and if you find out at that point that converting does not work, you will have lost a lot of time. This is the most typical conversion scenario I see, and it always fails.

You are lucky that the original programmer took the .exe with multiple .dll route. The only few conversions I have seen working in these 12 years were all designed that way.
LVL 83

Expert Comment

ID: 39238933
In .NET, you can have many projects under same solution (cant remember if VS6 supported this) so you can keep all your projects separate but under a single solution.
LVL 52

Expert Comment

by:Martin Liss
ID: 39306583
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
The PowerShell Core 6.0 of .NET release is just the beginning. The upcoming PowerShell Core 6.1 would have artificial intelligence and internet of things capabilities. So many things to look forward to in the upcoming release.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

606 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question