vb6 to asp.net conversion question

  • Thread starter Thread starter pb
  • Start date Start date
P

pb

Hi,
I am trying to convert some VB6 code to ASP.NET (as a way of
learning).

How would I declare the following in and vb.net code module?

Public Type POINTAPI()
x As Double
y As Double
End Type

Cheers,

Pb.
 
Do you have Visual Studio 2003 ?

If so, save a copy of the page which has your VB6 code and
use the Migration Assistant ( "File", "Open", "Convert" ).

It *really* helps when you want to convert VB6 to VB.NET.

See:
http://www.asp.net/migrationassistants/gettingstarted_asptoaspnet.htm

There's instructions for batch conversion from the command-line, too.
That makes it real easy to copy a hole directory and conert all the files.

The converter adds a lot of code comments, too,
so you'll get a lot of hints for a lot of converted code.





Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
 
I forgot to add, there's a handy comparison between VB6 and VB.NET here :
http://www.ondotnet.com/pub/a/dotnet/excerpt/vbnetnut_appa/index.html?page=1

In page 2, the guide explains :

In VB 6, a structure or user-defined type is declared using the Type...End Type structure.

In VB .NET, the Type statement is not supported.

Structures are declared using the Structure...End Structure construct.

Also, each member of the structure must be assigned an access modifier,
which can be Public, Protected, Friend, ProtectedFriend, or Private.

(The Dim keyword is equivalent to Public in this context.)

For instance, in page 2, the VB 6 user-defined type:

Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type

is defined in VB .NET as:

Structure RECT
Public Left As Long
Public Top As Long
Public Right As Long
Public Bottom As Long
End Structure

You'll find that guide quite useful.




Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
 
Hi Juan,

Will not the migration assistant run by default when we open a VB6
application using dotnet?
Or should I do as you said
"If so, save a copy of the page which has your VB6 code and
use the Migration Assistant ( "File", "Open", "Convert" )."

I would like to know the difference..if any..
 
re:
!> Will not the migration assistant run by default when we open a VB6 application using dotnet?

Yes, which is why I suggest you save a copy of the page before opening it.

If you don't save a copy, you'll lose your original file...permanently.
That might have consequences for you.




Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
 
Back
Top