[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

upgrade vb6 project with several dependancies to vb.net

Posted on 2013-06-09
9
Medium Priority
?
361 Views
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 vb.net.

do I combine all into 1 project?

what is the best approach
0
Comment
Question by:hainansyndrome
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 10

Expert Comment

by:Asim Nazir
ID: 39233987
Hi,

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

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

Accepted Solution

by:
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.
0
 

Author Comment

by:hainansyndrome
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.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

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

Author Comment

by:hainansyndrome
ID: 39235051
ok

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?
0
 
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.
0
 
LVL 83

Expert Comment

by:CodeCruiser
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.
0
 
LVL 49

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

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

649 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