Results 1 to 5 of 5

Thread: [2005] Scratch it or use Converter?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2006
    Location
    Between Try & Catch
    Posts
    249

    [2005] Scratch it or use Converter?

    Mods, feel free to move this thread. I didn't know whether to put it here or in the vb6 forum.

    I am currently upgrading a VB6 application to .Net.

    I tried using the converter, just for giggles, and I have A LOT of adjustments to make to get the program functioning properly in .Net. So, scratch it and start over right?

    The caveat is that there is a lot of code that I will be able to reuse. I say somewhere in the neighborhood of 80% of the code will be able to be used again. I'd say around 70% of that will be able to be used as is. So, following the percentage, it would seem that just converting and fixing would be the way to go.

    I'm at a crossroads here. When I really think about it, the best thing for me to do would probably be start from scratch, and just use good ol' copy and paste for the vb6 code that works already.

    Any thoughts from people that have already converted vb6 projects to .net?
    If my post helped you, please rate it!

    Languages: VB/ASP.NET 2005, C# 2008,VB6
    Databases: Oracle (knowledge not currently in use), DB2

    FROM Customers
    WHERE We_Know_What_We_Want <> DB.Null
    SELECT *
    0 rows returned

  2. #2
    PowerPoster Jenner's Avatar
    Join Date
    Jan 2008
    Location
    Mentor, OH
    Posts
    3,712

    Re: [2005] Scratch it or use Converter?

    Since you're getting into .NET, convert it and rewrite the parts that don't work. It takes about a solid year to really change to the .NET mentality from VB6. You'll be re-writing major blocks of your working code as you discover those better .NET methods for doing things.

    Then, when you are faced with the challenge of upgrading ANOTHER application to .NET, you'll have a much stronger knowledgebase and doing it from scratch would yield better results regardless.

    Of course, if you're already good with .NET, I'd do as you suggest. Start from scratch and cut-paste through the VB6 to VB.NET converter for functionblocks that don't require much rework.
    My CodeBank Submissions: TETRIS using VB.NET2010 and XNA4.0, Strong Encryption Class, Hardware ID Information Class, Generic .NET Data Provider Class, Lambda Function Example, Lat/Long to UTM Conversion Class, Audio Class using BASS.DLL

    Remember to RATE the people who helped you and mark your forum RESOLVED when you're done!

    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe. "
    - Albert Einstein

  3. #3
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: [2005] Scratch it or use Converter?

    Start over....sort of. If you have functions that will work fine, you can cut and paste them from VB6 to the .NET project. How those functions integrate into the new project is what you will be writing fresh, along with those pieces that can't be copied. For example, if you need a button, and the button click code is working fine, select the button click code from VB6, hit Ctrl+C, add a button to the new project at the right place, name it, etc., then double click to get the button click event handler outline, and paste in the copied code. You get the new program, but you get it much faster than you would if you had to re-write from scratch a bunch of low level stuff. I moved a medium sized program from VB6 to .NET in a couple days doing this.
    My usual boring signature: Nothing

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Dec 2006
    Location
    Between Try & Catch
    Posts
    249

    Re: [2005] Scratch it or use Converter?

    Quote Originally Posted by Jenner
    Of course, if you're already good with .NET, I'd do as you suggest. Start from scratch and cut-paste through the VB6 to VB.NET converter for functionblocks that don't require much rework.
    I wouldn't say I'm "good" with .Net (college grad at first job), but I'm a lot better with it than VB6.

    I appreciate the suggestions. I already started the "ground-up" approach, and have accomplished more in a couple of hours than I did in a whole day trying to fix the vb6 code that didn't work in .Net.
    If my post helped you, please rate it!

    Languages: VB/ASP.NET 2005, C# 2008,VB6
    Databases: Oracle (knowledge not currently in use), DB2

    FROM Customers
    WHERE We_Know_What_We_Want <> DB.Null
    SELECT *
    0 rows returned

  5. #5
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: [2005] Scratch it or use Converter?

    I would vote for rewritting as you get a chance to optimize your code and learn .net more that way. But if time is an issue you can take a partial migration approach by using the Forms Toolkit.

    http://msdn.microsoft.com/en-us/vbasic/bb419144.aspx
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

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