vb6 to asp.net conversion question

Discussion in 'ASP .Net' started by pb, Jun 2, 2007.

  1. pb

    pb Guest

    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.
     
    pb, Jun 2, 2007
    #1
    1. Advertising

  2. 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/
    ======================================
    "pb" <> wrote in message
    news:...
    > 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.
    >
     
    Juan T. Llibre, Jun 2, 2007
    #2
    1. Advertising

  3. 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/
    ======================================
    "Juan T. Llibre" <> wrote in message
    news:...
    > 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/
    > ======================================
    > "pb" <> wrote in message
    > news:...
    >> 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.
    >>

    >
    >
     
    Juan T. Llibre, Jun 2, 2007
    #3
  4. pb

    Guest

    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..
     
    , Jun 6, 2007
    #4
  5. 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/
    ======================================
    <> wrote in message
    news:...
    > 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..
    >
     
    Juan T. Llibre, Jun 6, 2007
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Carl Howarth

    ASP3/VB6 to ASP.NET/VB.NET

    Carl Howarth, Jul 8, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    409
    Steve C. Orr, MCSD
    Jul 8, 2003
  2. George Ter-Saakov

    Re: ASP.NET -> VB.NET -> VB6.0 DCOM

    George Ter-Saakov, Jun 2, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    640
    George Ter-Saakov
    Jun 3, 2004
  3. dotnetforfood
    Replies:
    18
    Views:
    737
    =?Utf-8?B?QWwtRmVlZA==?=
    Jul 2, 2004
  4. Patrick Bates

    From ASP/VB6 to ASP/VB .NET

    Patrick Bates, Jun 28, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    416
    Juan T. Llibre
    Jun 29, 2006
  5. rg
    Replies:
    7
    Views:
    880
    RobinS
    Nov 22, 2006
Loading...

Share This Page