vb6 to asp.net conversion question

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.
 
J

Juan T. Llibre

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.
 
J

Juan T. Llibre

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.
 
V

vergilfrans

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..
 
J

Juan T. Llibre

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top