VB.net 
Author Message
 VB.net

Quote:

> I've been looking at VB.NEt lately, is it really that
> difficult to import code to VB.net from VB6?

Oh yes.  Rewriting anything but the simplest Classic VB projects
for B# will make the migration from VB3 to VB4-32 look like that
from VB5 to VB6.  Don't look to the Migration Lizard to save you:

 URL: http://www.*-*-*.com/

Here is but a partial list of the changes:

 URL: http://www.*-*-*.com/

Are we having fun yet?

--
Joe Foster <mailto:jlfoster%40znet.com>  Wanna buy a Bridge? < http://www.*-*-*.com/ ;
WARNING: I cannot be held responsible for the above        They're   coming  to
because  my cats have  apparently  learned to type.        take me away, ha ha!



Sat, 11 Sep 2004 17:23:16 GMT  
 VB.net
Joe,

First, I will agree with you that the upgrade wizard is not always
extremely helpful.  There are a lot of things that it can't upgrade.  But,
you seem to have conveniently left out a couple key points.

1. You don't lose anything by running the upgrade wizard.  Let it run
overnight if you can't afford to let one of your computers process it for a
while during the day.  When the wizard is done you will have a new VB .NET
project with a todo list of things that it couldn't upgrade.  If the todo
list is short, then maybe the upgrade process will be relatively quick and
painless.  If the list is long, then you can think about if you really do
need to upgrade this project or just leave it in VB6.

2. Which brings us to our second point.  Do you really need to upgrade the
project?  As is pointed out in the devx article you mentioned: the only
applications worth migrating are the ones you intend to enhance with .NET.  
If your project is finished, or very close to it, then you probably should
leave it alone as you won't get any benefits out of the migration.  If you
are just starting a project, or you intend to significantly enhance an
existing project, then future development should be faster and more
powerfule under .NET.  So just because you have an upgrade wizard doesn't
mean you actually need to use it.

Also, if you are planning to upgrade from VB6 to VB .NET, then I would
suggest checking out "Upgrading Microsoft Visual Basic 6.0 to Microsoft
Visual Basic .NET" by Robinson, Bond, Oliver.

Kevin Williamson - Microsoft Visual Basic Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. ? 2001 Microsoft Corporation. All rights
reserved.

--------------------
| Reply-To: "Joe \"Nuke Me Xemu\" Foster" <jlf%#56;znet%2ecom>


| Subject: Re: VB.net
| Date: Tue, 26 Mar 2002 01:23:16 -0800
| Lines: 23
| Organization: North American Marcab-Teegeeack Love Association
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 5.50.4807.1700
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700

| Newsgroups: microsoft.public.vb.bugs
| NNTP-Posting-Host: okts03-116.znet.net 207.167.82.116
| Path: cpmsftngxa08!cpmsftngxa07!tkmsftngxs01!tkmsftngp01!tkmsftngp07
| Xref: cpmsftngxa08 microsoft.public.vb.bugs:48277
| X-Tomcat-NG: microsoft.public.vb.bugs
|


|
| > I've been looking at VB.NEt lately, is it really that
| > difficult to import code to VB.net from VB6?
|
| Oh yes.  Rewriting anything but the simplest Classic VB projects
| for B# will make the migration from VB3 to VB4-32 look like that
| from VB5 to VB6.  Don't look to the Migration Lizard to save you:
|
|  URL:http://devx.com/free/hotlinks/2002/ednote022002/ednote022002.asp
|
| Here is but a partial list of the changes:
|
|  URL:http://mvps.org/vb/rants/vfred.htm
|
| Are we having fun yet?
|
| --
| Joe Foster <mailto:jlfoster%40znet.com>  Wanna buy a Bridge?
<http://xenu.net/>
| WARNING: I cannot be held responsible for the above        They're  
coming  to
| because  my cats have  apparently  learned to type.        take me away,
ha ha!
|
|
|



Sat, 11 Sep 2004 23:48:19 GMT  
 VB.net


<cut>

Quote:
> 1. You don't lose anything by running the upgrade wizard.  Let it run
> overnight if you can't afford to let one of your computers process it for
a
> while during the day.  When the wizard is done you will have a new VB .NET
> project with a todo list of things that it couldn't upgrade.  If the todo
> list is short, then maybe the upgrade process will be relatively quick and
> painless.  If the list is long, then you can think about if you really do
> need to upgrade this project or just leave it in VB6.

There are some "gotchas" however.  One I can think of off the top of my head
is that DateDiff.
Take the following VB6 code for example:
Private Sub Main()
Dim d1 As Date
Dim d2 As Date
Dim l As Long
d1 = CDate("Jan 1 2002 11:00PM")
d2 = CDate("Jan 2 2002 01:00AM")
l = DateDiff("d", d1, d2)
MsgBox CStr(l), vbOKOnly, "Days"
End Sub

The Upgrade Wizard gave me this:
Public Sub Main()
Dim d1 As Date
Dim d2 As Date
Dim l As Integer
d1 = CDate("Jan 1 2002 11:00PM")
d2 = CDate("Jan 2 2002 01:00AM")
l = DateDiff(Microsoft.VisualBasic.DateInterval.Day, d1, d2)
MsgBox(CStr(l), MsgBoxStyle.OKOnly, "Days")
End Sub

The problem is that the result in VB6 is +1 while the result in VB.Net is 0.
I could argue that either is correct, but the difference introduces
potentially subtle bugs in code, especially in large projects.

My take on the upgrade wizard is that it's useful for getting pointers on
how to rewrite sections of code but what I think I'd do is run it and save
the project to the side for reference and then start over, testing each and
every procedure thoroughly.

Also, if I'm going to write code in VB.Net I'm going to use the dotnet-style
syntax and not the VB Classic syntax:
Public Sub Main()
Dim d1,d2 As Date
Dim l As Int32
d1 = Convert.ToDateTime("Jan 1 2002 11:00PM")
d2 = Convert.ToDateTime("Jan 2 2002 01:00AM")
l = d2.Date.Subtract(d1.Date).TotalDays
MessageBox.Show(l.ToString, "Days", MessageBoxButtons.OK)
End Sub



Sun, 12 Sep 2004 00:27:22 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Difference between VB NET and VB NET 2003

2. Convert VB.Net to C#, convert C# to VB.Net

3. VB.NEt Beginner: Creating a COM+ Object in VB.net

4. vb.net 2002 or vb.net 2003 beta

5. Accessing vb.net class from non.vb.net apps

6. VB.NET DLL's With A VB.NET App

7. VB.NET: Steps for Converting a Windows .NET Application to a Web .NET Application

8. ADO.NET with ASP.NET using VB.NET

9. how to use the system.net.sockets and system.net in VB.net

10. VS.Net + Cr.Net and VB.Net

11. REXEC from ASP.NET or VB.NET

12. VB.net and asp.net

 

 
Powered by phpBB® Forum Software