VB.Net
  Home arrow VB.Net arrow Page 3 - Migrating to Visual Basic.NET from Visual ...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Dedicated Servers  
Actuate Whitepapers 
Moblin 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
IBM developerWorks
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
VB.NET

Migrating to Visual Basic.NET from Visual Basic 6
By: Vaijayantee Sateesh Kamat
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 37
    2002-04-08

    Table of Contents:
  • Migrating to Visual Basic.NET from Visual Basic 6
  • Upgrading to Visual Basic.NET
  • Upgrade Report and Comments
  • Upgrade Report
  • Programming Recommendations
  • Control Changes in Visual Basic .NET
  • Summary

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th -1:00PM EST. Register Today!

    Migrating to Visual Basic.NET from Visual Basic 6 - Upgrade Report and Comments


    (Page 3 of 7 )

    We have time and again discussed that Visual Basic.NET is not a Visual Basic 6 Deluxe, but a totally different and an altogether new platform, which is compliant to .NET Framework. This does mean that there is no straightforward way to upgrade the existing Visual Basic 6 applications.

    Though the Upgrade Wizard handles many of the tasks for us, we have to do some modifications to the code manually. The different programming styles, some ambiguities like late binding, some not supported functions make it impossible to automate the task completely. Upgrading manually will not be possible without knowing Visual Basic.NET and the .NET framework. In other words, there is no shortcut for upgrading your existing applications. You have to learn Visual Basic.NET

    Upgrading Your First VB6 Application

    Unless we are using Standard edition of Visual Basic .NET, upgrading Visual Basic 6 applications is an almost automatic process in Visual Basic .NET. When you open a Visual Basic 6 application in Visual Basic.NET, the Upgrade Wizard steps in to guide you through the upgrade process. It creates a new Visual Basic.NET application leaving the original project untouched. When the project is upgraded, most of the code is modified to support new syntax and Visual Basic 6 forms are converted to Windows Forms. But, in most of the cases some manual modification is required because certain language features do not have any equivalent in Visual Basic.NET and also the automatic upgrade might not take any advantage of the new features in Visual Basic .NET.

    The Upgrade Wizard provides us with following options wherever available.

    1) What type of project to create:

    If the type of project chosen for upgrading is an ActiveX Exe or ActiveX Document Exe project, we can choose to upgrade it to either exe or dll project. The all the other projects this option is not available and the only other option available is already selected.

    2) Generate default interfaces for all public classes

    If the project chosen is not a Standard Exe project, then this option specifies how interfaces will be generated in the new project. By default, interfaces will only be generated for public classes that are implemented by other classes in the project. If all public classes option is selected, interfaces will be generated for all public classes even if they are not implemented

    3) Location for the project:

    This option lets us choose the folder for our new project. By default the project will be placed in a child folder of the current project. Default name of the new project will be projectname.NET.

    After the upgrade is complete, the Upgrade Wizard creates an Upgrade report for the project, itemizing the problems if any. It also adds comments to the converted code. They are displayed in the task list window as “To DO” task. Each task is associated with a help topic with a link.

    Let us now put the Upgrade Wizard to some work

    • Create a Project in Visual Basic 6
    • Add 3 Command Buttons, A Text Box and a label to the form. Name the Command Buttons: Cmdend, cmdForm2, command2

      Add Following Code
    • To the Click event of Cmdend, just add End
    • To the Click event of Command2, Ask some Text to be displayed in the text Box
    • In the Click event of the cmdForm2, just add Form2.Show
    • Give the Label1 some caption.
    • Add a second form
    • Have a label on it
    • In the form load event of this form, add Label1.Caption = Form1.Label1.Caption
    • Add a Command Button and in the click event just add Unload Me
    • Run and test the project in Visual Basic 6.
    • When you are sure that the project is running alright, save it and close Visual Basic 6. This is an important step. Unless the project is running well, the comments and report by the Upgrade Wizard might not be useful. Either the wizard may generate wrong code or might not know what to do.
    • Open Visual Basic.NET and open the same project. The Upgrade Wizard starts automatically with a welcome screen.


    Click on the next button to get the next screen that selects the type of project to be created



    As ours is a Standard Exe project, only Exe option is available.



    Now, let’s go to the next step and finalize the location of our project.. This done, the wizard just shows its progress while it processes the project. Now that the wizard has upgraded the project, let us examine the report created by it check if any manual changes are required.

    More VB.Net Articles
    More By Vaijayantee Sateesh Kamat


       · That was a very precise and helpful piece of information. My sincere thanks to the...
     

    VB.NET ARTICLES

    - MyClass - Implementing Polymorphism in VB.Net
    - Building a News Ticker Using VB.Net
    - Everything You Wanted to Know About Forms In...
    - Building Assemblies with VB.Net
    - Simple VB.NET Notify Icon with Panel Applica...
    - Regular Expressions in .NET
    - String Encryption With Visual Basic .NET
    - Deploying Applications in VB.NET: Part 1/2
    - Watching Folder Activity in VB.NET
    - Creating A Windows Service in VB.NET
    - Implementing The Google Web Service In VB.NET
    - Migrating to Visual Basic.NET from Visual Ba...







    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway