-
May 22nd, 2017, 05:53 PM
#1
Thread Starter
Hyperactive Member
Migrating a project from VB6 (!!) to VB2017
Notes for myself, and others.
1) Open in VB6.
Run project to make sure everything works and is updated.
2) Open that project in VB Express 2008.
Migrate!
3) Open the .vbproj in VS 2013.
Permanent migration. Never look back!
4) Open VS2013 project in VS2017 / VSCommunity
WOW. This is unreal that it actually worked.
Last edited by RipVoidWinkle; May 22nd, 2017 at 06:12 PM.
-
May 23rd, 2017, 08:08 AM
#2
Re: Migrating a project from VB6 (!!) to VB2017
I'm impressed #2 worked well enough for you.
-
May 23rd, 2017, 08:30 AM
#3
Re: Migrating a project from VB6 (!!) to VB2017
While it "works" ... it's not really a good practice. It's really only going to work for the basic of applications. It doesn't really update anything except the project itself. All ActiveX objects remain as they are, but may get slapped with a wrapper around it. It doesn't upgrade any use of ADO to ADO.NET. I don't think it changes much code... I'm not even sure it updates event handlers with Handles clauses, or if it wires them up with AddHandler.
It may be useful in getting a project started migrating to .NET, I wouldn't rely on the results as a long-term solution. The general recommendation is to re-start the project as a new one and go through the design. That doesn't necessarily mean chucking the old code. It can be cleaned up and ported over, but it should be a conscious effort and should also still be updated as needed.
-tg
-
May 23rd, 2017, 05:58 PM
#4
Re: Migrating a project from VB6 (!!) to VB2017
Even if the upgrade wizard worked, it didn't work well. However, if it DID work, then you could probably do a good job relatively easily. It wouldn't take you long to recreate the forms in .NET to look the same. Then you can copy and paste the method bodies into the event handlers, and copy other methods, changing as needed. The syntax is largely the same, but you can make changes as needed. This will end up with a better overall project. It isn't as fast as what you did, but it will be pretty fast. I did this on a modestly sized project, and the whole conversion took only a day or two. It was FAR faster than the original writing.
My usual boring signature: Nothing
-
May 23rd, 2017, 10:00 PM
#5
Thread Starter
Hyperactive Member
Re: Migrating a project from VB6 (!!) to VB2017
These are simple hobbyist caliber single form apps.
I noticed it had some pixelToTwips stuff in there, and I started removing that line by line.
The other thing I notice is the use of control arrays.
I am going to repaint the screen on a new form, and create arrays of controls explicitly (the code is hidden in the designer.vb or whatever)
I also noticed the event handlers have different arguments, so I manually cleaned up that code. eg: KeyPress
Paste body into new event handler template in VS2013.
It's not perfect, but it was a huge step in the right direction.
-
Sep 18th, 2017, 10:48 AM
#6
Hyperactive Member
Re: Migrating a project from VB6 (!!) to VB2017
Topic title should be renamed, how to move your vb6 project from closed source to open source...
Will try this soon, but I would imagine my 100k LOC project will not convert.
WP
-
Sep 18th, 2017, 11:12 AM
#7
Re: Migrating a project from VB6 (!!) to VB2017
Originally Posted by axisdj
Topic title should be renamed, how to move your vb6 project from closed source to open source...
Will try this soon, but I would imagine my 100k LOC project will not convert.
WP
It most certainly will NOT convert. At least, not to your satisfaction. What RVW is talking about is pretty simple apps, which may well convert well enough. Even in that case, he said he was manually cleaning up some code.
Besides, there is a crucial step that you probably can't perform: Open the project in VB Express 2008.
The key here is that 2008 was the last year that included the conversion application, which is why it worked at all. That conversion wizard was always pretty lousy and worked only somewhat on smaller programs. It was dropped entirely after 2008 as a bad piece of work. The languages are too different for any kind of automatic conversion to really matter.
My usual boring signature: Nothing
-
Sep 18th, 2017, 11:24 AM
#8
Re: Migrating a project from VB6 (!!) to VB2017
Hi,
I also tried to convert with vb2008, what came out I would discribe as
.Vbet6
regards
Chris
to hunt a species to extinction is not logical !
since 2010 the number of Tigers are rising again in 2016 - 3900 were counted. with Baby Callas it's 3901, my wife and I had 2-3 months the privilege of raising a Baby Tiger.
-
Sep 18th, 2017, 11:29 AM
#9
Re: Migrating a project from VB6 (!!) to VB2017
You did run your full suite of acceptance tests, right?
This answer is wrong. You should be using TableAdapter and Dictionaries instead.
-
Sep 18th, 2017, 11:32 AM
#10
Re: Migrating a project from VB6 (!!) to VB2017
Originally Posted by Sitten Spynne
You did run your full suite of acceptance tests, right?
for a single form hobbyist app?
-
Sep 18th, 2017, 11:54 AM
#11
Re: Migrating a project from VB6 (!!) to VB2017
Yeah, for a single form hobbyist app.
Acceptance Tests:
1) Does it work?
My usual boring signature: Nothing
-
Sep 18th, 2017, 01:06 PM
#12
Re: Migrating a project from VB6 (!!) to VB2017
Yes, for a single-form hobbyist app. Shaggy Hiker is more or less on the mark with what the acceptance test suite for such a thing might be.
You left out "I was translating a single-form hobbyist app". Those are so simple one can usually convert them by hand faster than installing 3 separate versions of Visual Studio and mucking about with multiple tools. The kind of people who usually ask about this tool are converting big enterprise apps and curious if it "just works", so it's important to mention the product scale so as not to mislead them.
This answer is wrong. You should be using TableAdapter and Dictionaries instead.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|