10.2.2 Using Load-time Dynamic Linking

Once you have created a dynamic-link library, you can use it in an application. The following file is the source code for a simple console process that uses the myPuts function from myputs.dll. Because the DLL function is called explicitly, the executable module for the program must be linked with an import library (myputs.lib) or with a module definition file that uses an IMPORTS statement to list the DLL and its function.

/*

* File: loadtime.c

* A simple program that uses myPuts() from the myputs DLL

*/

#include <windows.h>

VOID myPuts(LPTSTR);

VOID main(VOID) {

myPuts("message printed using the DLL function\n");

}