Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / General 2 / January 2004



Tip: Looking for answers? Try searching our database.

Porting from VB6 to VB.NET

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lisa Henkel - 26 Jan 2004 20:46 GMT
Hi.   I have a really important question for what I am trying to
accomplish this week as a volunteer:

Do programs that compile and run properly under VB6 compile and run
properly under VB.NET?  If not, what kind of changes do you have to
make to the VB6 code to get it to work in VB.NET?

I don't yet have VB.NET, and am currently working on a program in VB6
that we hope to port to VB.NET soon.

Thank you,

Lisa
Dag Sunde - 27 Jan 2004 00:34 GMT
> Hi.   I have a really important question for what I am trying to
> accomplish this week as a volunteer:
[quoted text clipped - 5 lines]
> I don't yet have VB.NET, and am currently working on a program in VB6
> that we hope to port to VB.NET soon.

The answer to your first question is: NO!
...to the second: anything from "A lot!" to "Everything!"

Most of the syntax is similar, *but*!
VB.NET is a new, different Language, it is not just the next
version of VB (as the difference between VB5 and VB6 was).

Different concepts, Different way of thinking, really (to utilize it
fully).

Completely new, and different class library, 20Mb runtime, etc, etc

Depending on how complex your application is, you may be better off
with a complete rewrite for .NET

--
Dag.
David Segall - 27 Jan 2004 14:12 GMT
Posted and emailed:

>Hi.   I have a really important question for what I am trying to
>accomplish this week as a volunteer:
>
>Do programs that compile and run properly under VB6 compile and run
>properly under VB.NET?
No.
>  If not, what kind of changes do you have to
>make to the VB6 code to get it to work in VB.NET?
Microsoft have a free download of Code Advisor for Visual Basic 6
(http://msdn.microsoft.com/vbasic/downloads/codeadvisor/default.aspx)
It's an add in for VB6 which will insert a comment for each line in a
VB6 program that needs to be changed to port it to .NET.

>I don't yet have VB.NET, and am currently working on a program in VB6
>that we hope to port to VB.NET soon.
>
>Thank you,
>
>Lisa
Steve Gerrard - 28 Jan 2004 05:54 GMT
> Hi.   I have a really important question for what I am trying to
> accomplish this week as a volunteer:
[quoted text clipped - 9 lines]
>
> Lisa

Some things you can do in VB6 to help the conversion (even if you end up
re-writing):

Don't use Variants and don't use Optional parameters.

Isolate code that calls APIs in separate functions, they will change
quite a bit.

Explicitly pass ByVal, unless you need ByRef.

Don't use default values, i.e. use Text1.Text, not Text1; use
MyCollection.Item(1), not MyCollection(1), etc.

Form code gets changed a lot. Put as much of the logic as possible in
seperate functions or classes, and call them from the event handlers.
Pass values from controls (i.e. Text1.Text), so your code is working
with ordinary variables as much as possible.

If you use ADO (or other major libraries), keep that code in separate
functions and classes as well.

The good thing about all that is it makes for better coding practices
anyway.

Imagine ripping out any code that refers to forms, controls, APIs, or
libraries. Arrange things so you have something left, because that is
basically what you will be doing, replacing the lot with references to
the Framework.
Mr Nobody - 31 Jan 2004 04:21 GMT
VB.Net bears very little resemblance to VB; it's a totally different
language. Microsoft publishes a 400 page book detailing the differences, and
makes an analyzer tool available that puts out a diagnostic for almost every
line in your VB6 program. Only the most simple, trivial programs can be
ported with little or no work.

> Hi.   I have a really important question for what I am trying to
> accomplish this week as a volunteer:
[quoted text clipped - 9 lines]
>
> Lisa
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.