• All Windows applications at their most basic level (even ones written
using Visual Basic) interact with the computer environment by using calls to dynamic
link libraries (DLL). DLL’s are libraries of routines, usually written in
C, C++, or Pascal, that you can link to and use at run-time.
DLL usually performs a specific function. By using DLL routines with Visual Basic,
you are able to extend your application’s capabilities by making use of
the many hundreds of functions that make up the Windows Application Programming
Interface (Windows API). These functions are used by virtually every application
to perform functions like displaying windows, file manipulation, printer control,
menus and dialog boxes, multimedia, string manipulation, graphics, and managing
• The advantage to using DLL’s is that you can use available routines
without having to duplicate the code in Basic. In many cases, there isn’t
even a way to do a function in Basic and calling a DLL routine is the only way
to accomplish the task. Or, if there is an equivalent function in Visual Basic,
using the corresponding DLL routine may be faster, more efficient, or more adaptable.
Reference material on DLL calls and the API run thousands of pages - we’ll
only scratch the surface here. A big challenge is just trying to figure out what
DLL procedures exist, what they do, and how to call them.
• There is a price to pay for access to this vast array of code. Once
you leave the protective surroundings of the Visual Basic environment, as you
must to call a DLL, you get to taunt and tease the dreaded general protection
fault (GPF) monster, which can bring your entire computer system to a screeching
halt! So, be careful. And, if you don’t have to use DLL’s, don’t.