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.
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:
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