Home > Microsoft .Net Development News > Can VB 6 and VB.NET forms coexist?
Microsoft .Net Development News:
EMAIL THIS

Can VB 6 and VB.NET forms coexist?

By Brian Eastwood, Associate Editor
23 Jun 2006 | SearchVB.com

Office Development Channel
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google

Visual Basic 2005 may be the latest incarnation of the 15-year-old programming language, but an ongoing survey of SearchVB.com readers indicates that more developers are still coding in VB 6 that in VB.NET. On top of that, Visual Basic 9, code-named Orcas, is due for release at the end of 2007. Each new release brings productivity enhancements but also questions about performance and migration.

At Tech Ed 2006, SearchVB.com attended several breakout sessions focused on Visual Basic 2005. This three-part series looks at the language's past, present and future.


Migrating a Visual Basic 6 application to VB.NET requires a significant investment of both time and money -- neither of which are in large supply for anyone. The process can be especially troublesome for large, forms-based applications, since in almost all cases a decent chunk of code will not make it through the VB 6 Conversion Wizard and will have to be converted by hand.

One option that will be available soon is a toolkit from Clarity Consulting that will let developers created "hybrid" applications in which VB 6 forms and VB.NET forms coexist in an application running on VB 6.

During a breakout session at Tech Ed, Jon Rauschenberger, CTO of Clarity, offered a demo of this toolkit. Clarity is developing the product jointly with Microsoft, and it will be available alter this summer as a free download.

The toolkit is not a code converter. Rather, it provides shared state, an application event broker and interoperable forms functionality. The latter piece, interoperable forms, is by far the most important part, Rauschenberger said.
More on VB 6 migration

Special Report: VB 6-to-VB.NET Migration

Tip: Migrating or converting from VB 6 to VB.NET

Developers create a new form in .NET and attribute the code, and the toolkit automatically generates a COM proxy. The resulting COM interface resembles a VB 6 form. "From a UI standpoint, you can't tell which version [of VB] I'm using," Rauschenberger said.

One major addition to VB.NET was My namespace, a resource locating framework that makes it easier to find and retrieve information from a file. Since VB 6 does not support My, the toolkit removes the resource and puts it in a namespace that VB 6 recognizes, Rauschenberger said.

"We want to keep VB 6 as familiar as possible while keeping the .NET experience as pure as possible," he continued. "There are no constraints on what you can do to a VB.NET form running in VB 6."

When migrating forms, it is a good idea to move over one functional unit at a time -- that is, both a master and a detail at the same time -- Rauschenberger said. Developers should also consider compiling all parts of a functional unit into a COM DLL; that way, there is a single executable, rather than one for each form.

Other considerations regarding the toolkit include the following:

  • The toolkit supports only four interface objects -- 32-bit integers, strings, Booleans and objects. This does hit 80% to 90% of support cases, Rauschenberger noted.
  • If a developer chooses to bring forward one VB 6 form in an interface, then all VB 6 forms will be brought forward.
  • When it's time to recompile VB.NET code, a developer has to close down VB 6. Otherwise, the build will fail.

    Go on to Part 2 of the series, Tips and time-savers for VB 2005 application development
    Go on to Part 3 of the series, What to expect from Vista development, VB 9


    Tags: .NET Framework 2.0 and Visual Studio 2005 developmentVisual Basic 6 programming languageVIEW ALL TAGS

    Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google



    RELATED CONTENT
    .NET Framework 2.0 and Visual Studio 2005 development
    Mono 2.0 moves .NET apps to Linux - includes migration analyzer
    Using the Visual Studio 2005 DataSet Designer to build a data access layer
    SCM Visual Studio plug-in offers updated interface
    Assembly versioning in the .NET Framework 2.0
    SearchVB.com's Podcast Page
    Visual Studio 2008 Learning Guide: Multi-targeting
    On managing a .NET Framework 1.x migration
    Case Study: IdeaBlade DevForce object mapping
    Book excerpt: Printing in Visual Basic 2005
    CodeGear RAD Studio now supports .NET 2.0

    Visual Basic 6 programming language
    Inside Visual Studio 2010
    VB code download home page
    VB code: Windows operations downloads
    VB code: System control downloads
    VB code: String manipulation downloads
    SearchVB.com's Top 10 Downloads of Fall 2006
    Choosing VB.NET or C# Learning Guide
    Recent VBCode.com downloads, December 2006
    Quiz: What do you know about VB 6 migration?
    Answers: What do you know about VB 6 migration?

    RELATED GLOSSARY TERMS
    Terms from Whatis.com − the technology online dictionary
    IronRuby  (SearchWinDevelopment.com)

    RELATED RESOURCES
    2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
    Search Bitpipe.com for the latest white papers and business webcasts
    Whatis.com, the online computer dictionary



  • Development Solutions - Silverlight, WinForms, ASP.NET
    About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
    SEARCH 
    TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

    TechTarget Corporate Web Site  |  Media Kits  |  Site Map




    All Rights Reserved, Copyright 2000 - 2009, TechTarget | Read our Privacy Policy
      TechTarget - The IT Media ROI Experts