VISUAL BASIC PC Hardware | PC Software | Networking | Web Designs | News Letter | Home |
Visual Basic | C++ | Java |
CALLING THE WINDOWS API AND DLLs IN GENERAL |
What is the Windows API?The Windows API (Application Program Interface) is a collection of Dynamic-Link Libraries (DLLs) that do most of the common things in Windows. Calls to the Windows API gives you access to routines that do things like drawing menu bars, manipulating bitmaps, playing sound files, and pretty much every other function of Windows. How do I call a DLL?Basically, you declare a DLL procedure which you can call in your VB program which in turn passes data to and/or retrieves data from the DLL. You should read the section of the VB manual that talks about calling DLLs ("Chapter 24 Calling Procedures in DLLs" in the VB 3.0 Programmer's Guide). This chapter covers the basics of using the Windows API DLLs and calling DLLs in general. Beyond that you may want to find a good book on this subject since it is too large to cover here (see the Book Listing in the Appendix of the General FAQ - Part 1). Don't be too intimidated! Using DLLs (especially many of the Windows API functions) is quite easy, once you learn how to call them. In fact, many of the newer DLLs include VB-compatible modules! What about DLL calls that require callbacks?VB 5.0 supports real callback functions, and full (?) access to Windows API functions. See example under AddressOf operator in help/docs. VB 4.0 and up support callbacks with OLE automation only.VB 4.0 can also create OLE DLLs with VB. VB 3 does not support callbacks, but various extensions can help. Dan
Appleman's "Visual Basic Programmer's Guide to the Windows
API" comes with a floppy disk which code samples and tools. It also
includes a VBX which supports the callbacks which many API calls
require. Dan is also founder and president of Desaware
which sells more extensive tools, including SpyWorks, for VB developers.
Dan's update for Windows 95 is called The
Visual Basic Programmer's Guide To the Win32 API. Tips for calling DLLs (such as the Windows API)
DISTRIBUTING VISUAL BASIC APPLICATIONSWhat are some tips for using Setup Wizard?Setup Wizard for VB 4 and 5 is finally a fully capable product. Applies to VB 3.0: There were loads of bugs in the setup utilities supplied with VB3. Be sure to get the newest version of SETUPKIT (usually called SETUPK.EXE or -.ZIP). It is available from the sources listed in the beginning of this document, and in the General FAQ. Alternatively, if you have the older versions, you may have to manually remove the line referring to OLE2UI.DLL in the file SETUPWIZ.INI. See later in this document for dates of newest files on ftp.microsoft.com.
|
For more details contact the webmaster |