John Swenson
MSDN Content Development Group
As Web development merges with the world of Windows-based development, Microsoft is working on new ways to further blend these two programming models into its tools. If you're a developer for Windows, there's no need to sit and wait for these new Web-enabled tools to arrive, however. Plenty of ways exist to use today's tools to add Web technologies to your Windows-based applications. In some cases, you can even save yourself work over more traditional Windows programming methods.
Chief among these new development methods is to use Dynamic HTML with Visual Basic 5.0. Visual Basic developers can save themselves a lot of time and effort—and turn out better applications—if they insert Dynamic HTML into the appropriate parts of their Visual Basic applications, says David Stutz, an architect on the Microsoft Visual Basic team.
"There are a bunch of things that are really easy to do in Dynamic HTML, but are hard to do with Win32," he says. Stutz rattles off a long list of items that are simpler to program in Dynamic HTML, such as styles, nested tables, automatic layout, and fancy typography.
Then there's the user interface—probably the greatest strength of Dynamic HTML. With Dynamic HTML, developers can put a richer, more interactive user interface on their Visual Basic–based applications. They can create forms that tightly integrate typography with database content, forms that dynamically change the controls that they contain, and even forms that exploit multimedia effects. (For a complete primer on what Dynamic HTML can do, see the Microsoft Site Builder Network Web site at http://microsoft.com/workshop/author/dhtml/.)
For programmers, the coolest and most far-reaching feature of Dynamic HTML is its tendency toward separating logic from an application's look and feel, and navigation from content, Stutz says. This simple four-way division is extremely powerful:
Taken together, these four capabilities of Dynamic HTML can significantly reduce the amount of code written.
Unfortunately, few programmers for Windows think of using a familiar programming tool such as Visual Basic to add Web technologies to their applications. That's too bad, Stutz says, since there are many benefits to using Dynamic HTML in addition to Visual Basic forms.
For example, a developer who wants to create a scroll bar in Visual Basic has to write a lot of code. But if the same developer created a hybrid application that mixed HTML pages with Visual Basic forms, their application would have built-in scrollbars. HTML also has the notion of hyperlinking built into the format, eliminating the need to write code for navigating between pages.
When you blend Dynamic HTML and other Web technologies with Visual Basic, you end up with hybrid applications that look like they're part Web and part Windows. These hybrid applications take advantage of the strengths of both platforms, and are clearly the wave of the future, Stutz says.
"We anticipate that hybrid applications are actually going to become the norm," he predicts. Stutz mentions Microsoft Money 98 as a prime example of one of these hybrid applications, where it's hard to tell when you're in a Windows screen and when you're in an HTML page.
For a primer on when Visual Basic programmers should use Dynamic HTML as a complement to the Win32 API, read Stutz's article "Building Dynamic Visual Basic Programs with DHTML." Although Stutz's main job is to design future versions of Visual Basic, he's been spending time lately visiting conferences to spread the word about using Dynamic HTML and other Web technologies with Visual Basic. The article contains highlights from his presentations.