PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
VS 2010 How tough is it to convert vb6 to vb.net?-VBForums
Results 1 to 34 of 34

Thread: How tough is it to convert vb6 to vb.net?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2007
    Posts
    544

    How tough is it to convert vb6 to vb.net?

    Just curious.

    Maybe it's time for me to move on.

    I used collection class heavily

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,335

    Re: How tough is it to convert vb6 to vb.net?

    The answer to your question does not necessarily depend on the code, but, more on your level of experience with VB.NET

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2007
    Posts
    544

    Re: How tough is it to convert vb6 to vb.net?

    I am thinking of converting. Get it to run. And after that modify the program a little bit as time goes by to take advantage of the object oriented paradigm.

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2007
    Posts
    544

    Re: How tough is it to convert vb6 to vb.net?

    The thing is I have made many programs and they all use the many common vb6 files.

    So should I make a one big project that use ALL of those VB6 files or can we convert one VB6 files at a time as needed.

  5. #5
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    34,889

    Re: How tough is it to convert vb6 to vb.net?

    The conversion wizard doesn't do a great job, and it never will. Therefore, it is highly recommended that you redesign when moving to .NET. This doesn't mean that you have to start over, as individual functions and the like can be copied and pasted from one to the other. However, because of the significant changes in features between the two languages, each individual function should be re-considered, at the very least.

    I found that moving a program from VB6 into .NET was a significant amount of work, but considerably less than starting over.
    My usual boring signature: Nothing

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2007
    Posts
    544

    Re: How tough is it to convert vb6 to vb.net?

    One of the thing that an amateur programmer like me love in VB6 is I can thread the vbp files like a .exe files.

    All the files are in a library.

    So all vbp (project files) reference that same library.

    I think we got to do some setting first in vb.net to achieve the same thing do we?

  7. #7
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    34,889

    Re: How tough is it to convert vb6 to vb.net?

    I'm not even sure what you mean by "thread the vbp files". VB6 doesn't allow threading, so that can't be it.

    You can certainly make dll files in .NET, just create a class library project and put things in there.
    My usual boring signature: Nothing

  8. #8
    Addicted Member ZenDisaster's Avatar
    Join Date
    Dec 2006
    Location
    Bay Area, CA
    Posts
    140

    Re: How tough is it to convert vb6 to vb.net?

    There's a little utility included in vs to convert your vb6 projects to .net but it just made a big broken mess every time I used it.

    There's really too much to talk about here so I would say just install the latest visual studio sidexside with your vs6 and play around with it until you are comfortable in it. Then you can make your own informed decision.

    Best of luck to you.
    Last edited by ZenDisaster; Sep 23rd, 2009 at 03:28 PM. Reason: Too much answer and opinion.

  9. #9
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: How tough is it to convert vb6 to vb.net?

    Then of course there's multithreading. Which I've found a real need for only once. Nevertheless, it's a novelty at your disposal. Still not sure if it's a whole lot easier then compiling a DLL in vb6 which gave pretty much the same results.
    Firstly, multi-threading is extremely useful and I use it in almost every program I write... Secondly, how is compiling a DLL anything like multi-threading :S Are we talking about different things here? A DLL is a library of code, multi-threading is running multiple blocks of code at the same time.
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  10. #10

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2007
    Posts
    544

    Re: How tough is it to convert vb6 to vb.net?

    For multithread, I run multiple copies of my program

  11. #11
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: How tough is it to convert vb6 to vb.net?

    Quote Originally Posted by teguh123 View Post
    For multithread, I run multiple copies of my program
    I hope thats a joke
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  12. #12

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2007
    Posts
    544

    Re: How tough is it to convert vb6 to vb.net?

    Quote Originally Posted by chris128 View Post
    I hope thats a joke
    No.

    So my program would lock files and then unlock it again to avoid file conflict.

    Sound like a pathetic joke right? It's pathetic, but no joke.

  13. #13
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,966

    Re: How tough is it to convert vb6 to vb.net?

    Hey,

    That is certainly not what Chris, and the .Net framework understand as multithreading.

    http://dev.mysql.com/doc/refman/5.0/...-prepared.html

    Gary

  14. #14

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2007
    Posts
    544

    Re: How tough is it to convert vb6 to vb.net?

    I am an old dog... Too tired to learn new tricks.

  15. #15
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,966

    Re: How tough is it to convert vb6 to vb.net?

    Hey,

    If you are going to go to .Net, then you have to be prepared for lots of new tricks

    Gary

  16. #16
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    34,889

    Re: How tough is it to convert vb6 to vb.net?

    Man, ZenDisaster has some bitterness.

    I loved VB6 for the years that I worked in it (ok, it started back before 6, but they were all about the same from 4 to 6). I would never willingly go back to it, though. The advantages of .NET and the new IDE are simply too great. Heck, you couldn't really use VB6 for mobile dev, nor did it work well with multi-core processors, and while you could do OO style code management, it wasn't real.

    Multithreading is a whole different way of looking at program design, but there is sound reason to consider things from that perspective. Moore's Law is not dead. The number of transistors on a chip is still increasing. Unfortunately, pushing clock timing higher and higher doesn't appear to be possible, and there is a limit to how efficient the instructions can operate at. Therefore, we are moving to multiple cores. To see performance increases in this new world we'll need to be able to be able to spread the execution out across all available processors. That's where multi-threading will shine. However, there are still many programs that really don't need multi-threading because they are just linnear processes and don't make logical sense any other way. Still, for most programs there is some advantage to be gained with threading.
    My usual boring signature: Nothing

  17. #17
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: How tough is it to convert vb6 to vb.net?

    So in VB6 if you didnt have multi-threading then what did you do if you had a form and you wanted to do some long running task, did the form just freeze for the duration of the task?
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  18. #18
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    34,889

    Re: How tough is it to convert vb6 to vb.net?

    DoEvents!
    My usual boring signature: Nothing

  19. #19
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: How tough is it to convert vb6 to vb.net?

    Really? That was the only option?
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  20. #20
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,966

    Re: How tough is it to convert vb6 to vb.net?

    Ah, the wonder of DoEvents

  21. #21
    Fanatic Member
    Join Date
    Sep 2005
    Location
    Toledo, OH
    Posts
    785

    Re: How tough is it to convert vb6 to vb.net?

    haha that's funny. i remember making the transistion from vb6 to vb.net and trying to use DoEvents to update my form... yeah.. you can bet I had a look of oh crap.. on my face.

  22. #22
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    34,889

    Re: How tough is it to convert vb6 to vb.net?

    Woka came up with some means to do multithreading, after a fashion, if I remember right, but DoEvents was pretty much the only way for the rest of us.
    My usual boring signature: Nothing

  23. #23
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    34,889

    Re: How tough is it to convert vb6 to vb.net?

    Quote Originally Posted by TheUsed View Post
    haha that's funny. i remember making the transistion from vb6 to vb.net and trying to use DoEvents to update my form... yeah.. you can bet I had a look of oh crap.. on my face.
    DoEvents still exists, and is still useful. For some reason, people disparage it, but there are times where it is the simplest and most elegant solution.
    My usual boring signature: Nothing

  24. #24
    Fanatic Member
    Join Date
    Sep 2005
    Location
    Toledo, OH
    Posts
    785

    Re: How tough is it to convert vb6 to vb.net?

    It is? what namespace is required?

    Ah it's the Application.DoEvents

    After I tried from first converting and it wouldn't work or couldn't figure out how, I just changed my methods of programming. It went smoothly.

    I have a feeling the .net framework will be around for many more years. So it is best to start now rather than later if you are going to continue to program...

  25. #25
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,966

    Re: How tough is it to convert vb6 to vb.net?

    Yeah, don't get me wrong, DoEvents, still has it's place, but I have seen examples where it gets highly abused.

    I am in agreement with TheUsed, I think the conversion to .net would serve you better in the future.

    Gary

  26. #26
    Fanatic Member
    Join Date
    Sep 2005
    Location
    Toledo, OH
    Posts
    785

    Re: How tough is it to convert vb6 to vb.net?

    Quote Originally Posted by Shaggy Hiker View Post
    Woka came up with some means to do multithreading, after a fashion, if I remember right, but DoEvents was pretty much the only way for the rest of us.
    I second that. His thread was the one I read about proving it was possible.

    It represented multithreading but wasn't ACTUALLY what we now know as multithreading.

  27. #27
    PowerPoster i00's Avatar
    Join Date
    Mar 2002
    Location
    1/2 way accross the galaxy.. and then some
    Posts
    2,347

    Re: How tough is it to convert vb6 to vb.net?

    Quote Originally Posted by chris128 View Post
    Firstly, multi-threading is extremely useful and I use it in almost every program I write... Secondly, how is compiling a DLL anything like multi-threading :S Are we talking about different things here? A DLL is a library of code, multi-threading is running multiple blocks of code at the same time.
    I use multi threading all the time and I would find it hard to go back to vb6 - however - contradictory to common belief multi threading is possible in vb6 - but you have to have a separate dll for each thread - I never used it myself but there are threading options for a dll project if you right click on the project and goto properties.

    Kris

  28. #28

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2007
    Posts
    544

    Re: How tough is it to convert vb6 to vb.net?

    Yea I know. 1 thread is enough for me for now.

    Now I have a lot of

    For Each var In col

    Where var is variant.

    Of course, most of the time I'd rather use type strong datatype. However, collection always ask variant.

    If var were a string, we cannot use for each.

    Am I correct?

    For each control variable must be variant or object.

    See, I am FORCED to use late binding in VB6 and now Microsoft code advisor suggest that I use an early binding stuff.

    That's a big issue because I use collection alot. It's so easy to iterate to through them. Maybe I should have used array instead do I?

  29. #29
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: How tough is it to convert vb6 to vb.net?

    In VB.NET you can do:
    vb Code:
    1. For Each var As String In MyStringCollection
    2.    'do stuff here
    3. Next
    and MyStringCollection could be strongly typed list, e.g List(Of String)
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  30. #30

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2007
    Posts
    544

    Re: How tough is it to convert vb6 to vb.net?

    Yes. But before migrating I am supposed to clean my vb6 code first right?

    There is no string collection class.

    In VB.net you can use template.

    I miss c++

  31. #31
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    34,889

    Re: How tough is it to convert vb6 to vb.net?

    Where is there no string collection class? I don't even remember that from VB6, though it certainly has been a while. In .NET, how much different is List (of String)?
    My usual boring signature: Nothing

  32. #32
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: How tough is it to convert vb6 to vb.net?

    Yes. But before migrating I am supposed to clean my vb6 code first right?
    I dont know about that... modifying your VB6 code to try and fit into .NET ways seems pretty pointless to me, why not just move to .NET at the same time and then you havent got to try and do things in VB6 that VB6 cant really do..
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  33. #33
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,966

    Re: How tough is it to convert vb6 to vb.net?

    Hey,

    As Shaggy has correctly pointed out, you could use a List. But if it is actually a String Collection that you are after, why not use a StringCollection, you can find it in the System.Collections.Specialized namespace:

    http://msdn.microsoft.com/en-us/libr...ollection.aspx

    Hope that helps!!

    Gary

  34. #34
    New Member
    Join Date
    May 2011
    Posts
    1

    Re: How tough is it to convert vb6 to vb.net?

    Using automated Tools it is not a tough task. The Upgrade Wizard in VS2005 and Vs2008 did a good job, but this tool is not available in VS 2010 or VS 2010 Express. So you can get the
    Visual Basic Upgrade Companion from: http://msdn.microsoft.com/en-us/vbasic/ff793478

    This tool has a lot of enhancenments for example:

    Data type enhancements

    Collections are upgraded to ArrayList or HashTable depending on their usage.
    Integer to enumerate: when integers are used where an enum name is expected, The VBUC converts it to the corresponding VB6 enum field, and the maps it to the semantic equivalent in .NET.
    IIF expressions: if the two expressions returned by the IIF have equivalent types, only one coercion is generated for the whole IIF invocation. Otherwise each expression is handled in the most appropriate way to make it match the expected type.
    Several cases for conversions between types: objects to scalars (unboxing cases), dates vs. strings, arrays to arrays, fixed strings, octals and hexadecimals, etc.
    Advanced transformations for arrays in most Dim and ReDim scenarios.
    Integer data type variables can be optionally upgraded to Short or Integer depending on their arithmetical usage.
    Enum Advanced conversions for:
    - Enums in comparison operators.
    - Enum values being transmitted as By-Ref.
    - Coercions between Enums and other primitive data types.
    Transformations for fixed size strings.

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width