UNDERSTANDING DYNAMIC LINK LIBRARIES

Before jumping into the syntax of API calls and how to use them, look at the files these routines are located in—dynamic link libraries. Dynamic link libraries, called DLLs for short, are exactly what the name implies—libraries of routines that are linked dynamically at runtime.

Links Performed

In the DOS days, if you made a change to a routine library, separate from the application or to the application itself, you would have to link both again. Not true with DLLs. A DLL doesn't get pulled into an application until runtime, so you can make changes independently and not have to worry about compiling and linking the files together. Of course, you still have to be careful that the calls that you make to the DLL will still work after your modification.

Memory Considerations

In addition to when linking is performed, another consideration is that the routines kept in DLLs are pulled into memory individually with some overhead, rather than the whole library, thereby saving memory. When the routine is completed, it's then released, freeing up memory again.

Commonly Used DLLs

Some of the most commonly used DLLs are those used by Windows itself: Advapi32.dll, Gdi32.dll, Kernel32.dll, Mpr.dll, Winmm.dll, and User32.dll. You'll see API calls with these files as the libraries later, in the section “Looking at Some Examples of API Calls.” It's time now to look at the syntax, and what it takes to call API routines from VBA.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.220.34.198