Results 1 to 5 of 5

Thread: [RESOLVED] [2005] convert vb6 to vb.net 2

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    586

    Resolved [RESOLVED] [2005] convert vb6 to vb.net 2

    Hello,

    I have a quite big code and gui written in vb6. most of it is allready written in classes, but some part of it is not.

    what is the best method to go about converting to vb.net?

    is their a good converter for it?
    if not what is the best approach for doing such a convert manually?

    thanks,

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: [2005] convert vb6 to vb.net 2

    You can open a VB6 project in VS 2005 and it will convert it for you. Having said that, the code produced by the converter is far from optimal. It's not really the fault of the tool; it's just that the two languages are more different than you might think, despite the similar syntax. A large project converted will contain numerous errors that you would have to fix manually and the code you would end up with would not closely resemble what a good VB.NET developer would write from scratch. It would contain numerous hacks and workarounds.

    Most developers experienced in both (which I am not, but I've read a lot of their posts ) recommend a manual rewrite over using the conversion wizard. It's possible to get VB6 apps to use .NET libraries and vice versa so if your app is well modularised then you can just pick a chunk at a time to work on.

    Note also that when writing new VB.NET code to replace VB6 code you should not try to "convert the code" as such. You should concentrate on the functionality that is provided by the VB6 app and find the best way to implement that same functionality in VB.NET. It's the direct "convert the code" approach that the conversion wizard uses that creates such dodgy code when it's done.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    586

    Re: [2005] convert vb6 to vb.net 2

    thank you for the detailed reply.

    - do you know other converting tools that do a better job?
    - about manual convert is there a certain order I should go about (for instance: first create the classes and other objects, than create the functions, and then each form)

    thanks,

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: [2005] convert vb6 to vb.net 2

    I'm not aware of any other tools that will convert VB6 to VB.NET, although there may be some. As for performing a manual rewrite, you should treat it like a new app and develop it in the same way you would nay other app. As I said, if your VB6 app uses multiple libraries then you can convert one library at a time. Still each library should be treated like a new project.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    586

    Re: [2005] convert vb6 to vb.net 2

    thank you, that was helpful

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width