|
-
May 31st, 2003, 09:09 AM
#1
Thread Starter
Fanatic Member
Upgrade VB 6 code to VB.NET
There's this client who has some VB 6 code in an application for PDA development on Windows CE. Now, he needs this code to be converted into VB.NET code.
I reckon Microsoft has been touting a host of upgrade tools since yore long before .NET was in beta. I've never touched .NET in real but for reading about it from an arm's length. Is is true that I could simply use an upgrade wizard in the .NET environment (VS.NET) that would take only a few seconds to convert all the VB 6 code to .NET? If it isn't, how do I go about it? What I mean here is that if it isn't, is there some other off-the-shelf component that would do the needful?
-
May 31st, 2003, 10:46 AM
#2
Fanatic Member
well,
when you open up a vb6 project in vs.net, you will be asked if you would like to upgrade that project... Choosing yes, VS.NET will go through a bunch of processing, and pick through your code, updating the syntax everywhere...
this in theory should work well, but there are a few quirks to it... for example, DoEvents as used in vb6 did not get upgraded to .NET for me, so i had to fix that up (i remember this from doing exactly what you want to do awhile back)...
and of course if you used ocx's from vb6, you're still using ocx's that are written in vb6.... As for API calls, i'm not 100% sure how those are handled... maybe someone could elaborate on this portion of the process?
But in the end, it really depends on how complex your vb6 project is... If you use a lot of 3rd party stuff, and api calls, it may be difficult to upgrade without a lot of work.... also keep in mind, i'm quite sure things such as ADO objects and whatnot are not the preferred method of doing things in .NET... ADO.NET is the preferred way, and vs.net cannot upgrade this part of it simply because there is a whole different mindset to programming with ADO.NET and controls (databinding and whatnot)...
So realistically, vs.net can upgrade an old vb6 project, however some of the unorthodox methods that vb6 used to do things may be obsolete... they may still work upgraded, but they are not how .NET is intended to be used...
If your application does a lot of database work, or uses alot of other specialized stuff, it may be worth considering recoding it in .NET instead of just letting vs.net upgrade... of course you may still want to upgrade it to see how well it works.. and at the very least, use that upgrade as a basis for recoding...
it really depends on each case... hopefully you can work something out
-
Jun 2nd, 2003, 08:51 AM
#3
Do not use converter. Learn .NET and re-write it.
-
Jun 3rd, 2003, 02:35 AM
#4
Hyperactive Member
"The passion lives to keep your faith, though all are different, all are great" ... Michael Hutchence 1960-1997.
Windows & Web Developer
Specialising in Visual Basic .Net & Client Server Programming & Client/Customer Relations Databases
Sutherland Shire, Sydney Australia
www.stingrae.com.au
Developer of Arnold - Gym & Martial Arts Database Management System
www.gymdatabase.com.au
-
Jun 3rd, 2003, 03:09 AM
#5
Thread Starter
Fanatic Member
Vow! thanks, guys. What a reputation the Upgrade Wizard has!
-
Jun 3rd, 2003, 12:00 PM
#6
I wonder how many charact
Nonsense, the upgrade wizard perfectly converted the following project listed below:
VB Code:
Public Main()
Msgbox ("Hello World")
End Sub
And this one:
VB Code:
Public Sub Form1_Load()
Dim i as integer
For i = 0 to 10
Form1.Print ("HI")
Next
End Sub
You can successfully convert millions of Vb6 projects such as the ones listed above...
-
Jun 3rd, 2003, 12:09 PM
#7
LOL.
Actually the first one wont. It will use that Microsofft.VB namespace isntead of the proper MessageBox.Show
-
Jun 4th, 2003, 02:03 AM
#8
Thread Starter
Fanatic Member
Unfortunately for me, my project doesn't look anything like that.
-
Jun 4th, 2003, 08:52 AM
#9
Fanatic Member
Usually for large projects even Microsoft recommends that you either write the application from scratch using VB.NET or keep it in VB6. [Often the cost of re-writing the application in .NET is almost 60% of the first development cost.]
However, I think since your project is supposed to run in a PDA, the code won't be that complicated. Was your code written in AppForge's mobileVB? Then I think you can update it to .NET as well because as far as I know AppForge also supports .NET (though I myself didn't test it)!
Life is a one way journey, not a destination. Travel it with a smile and never regret anything.
Yesterday is history, tomorrow is a mystery, today is gift - that's why we call it present.
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
|