Extend Visual Basic four ways. (Microsoft Visual Basic)(column) (Evaluation)
by Clifton Karnes
As I pointed out last month, one of the most exciting things about Microsoft Visual Basic is that it's extensible. Extending a language is nothing new, but the power of Windows combined with VB's open design creates an unusually rich environment for add-on developers.
>From Windows, VB gets the ability to use DLLs (Dynamic Link Libraries)--routines linked at runtime rather than at compile time. And unique to VB are custom controls--Visual Basic extensions (VBXs)--that become part of the VB design and runtime environments.
The custom control camp is represented by two excellent programs: Button Tool (OutRider Systems, 3701 Kirby, Suite 1196, Houston, Texas 77098; 713-512-0486; $49.95) and Custom Control Factory (Desaware, 5 Town & Country Village #790, San Jose California 95128; 408-377-4470; $48.00). Both of these programs dramatically increase Visual Basic's button power.
ButtonTool couldn't be much easier to use. To access the program;s custom buttom control, you load the BTOOL.VBX file into VB's design environment, and a new button tool appears on your toolbox. To create a button, you select it and draw your button the way you would with VB's native button control. When you look at the properties bar, you'll see the difference between this button and VB's.
ButtonTool adds 23 properties to VB's already healthy group of 21. For starters, you'll find 3-D shading and thickness, button down (which allows you to control exactly how the button looks when depressed), toggled (which allows you to treat command buttons like the option or check buttons used on tool bars), and symbols (which allows you to place 18 predefined symbols or your own bitmap, metafile, or icon on a button top). The ability to add a graphic to a button is especially welcome. It's amazing that Microsoft left this feature out of VB's first release.
After you've compiled your VB program with ButtonTool's controls and you're ready to distribute it, you need to include BTOOL.VBX runtime, which weighs in at a mere 14,288 bytes. The Runtime can be distributed royalty-free.
Desaware's Custom Control Factory (CCF) offers button control features similar to OutRider's, but CCF includes animated buttons and multistate check buttons.
You use CCF just the way you use ButtonTool. You choose Add File from the File menu and load CCBUTTON.VBX. However, when you draw a CFF button on your form, you're starting at square one. You'll see a blank button with handles for moving and resizing. You have to build most of its properties yourself. CCF is powerful and correspondingly more difficult to use than ButtonTool. Programs compiled with CFF require you to distribute the 94,960-byte CCBUTTON.VBX runtime. Like ButtonTool, distribution of this runtime is royalty-free.
ButtonTool and CCF are both excellent ways to extend the power of VB. When you find yourself wanting runtime routines, look at packages from MicroHelp and Crescent.
MicroHelp's VBTools (4636 Huntridge Drive, Roswell, Georgia 30075; 404-594-1185; $129) combines some unusual custom controls with a large toolbox of routines and forms. Controls include mouse scroll bars, an enhanced list box, 3-D labels, playing cards, percent gauges, and an enhanced text box.
Custom forms include a color editor, automatic text recall, project windows, and file selection routines. The library of runtime routines reinstates some common BASIC keywords Microsoft omitted from VB (like BSAVE and BLOAD) and contains graphics special effects, many examples of using the Windows API, and a blackjack game. Runtime modules can be distributed royalty-free.
VBTools is an impressive collection of controls, custom forms, and utilities. MicroHelp also touts a communications library and another collection of subroutines called Muscle.
Crescent Software's QuickPak Professional (32 Seventy Acres, West Redding, Connecticut 06896; 203-438-5300; $199) was still in prerelease when I reviewed it, but the software was very stable. This product obviously trys to provide every subroutine you'll ever need.
If you've used Crescent's QuickPak Professional for QuickBASIC and MS-BASIC, you have an idea of what's inside--lots of routines, most with source language included. More than just a translation of previous QuickPak modules, this collection boasts a large number of VB-specific routines. I'll include an update when I've seen the finished product.