/*********************************************************************/ /* dll_test.c */ /* */ /* sample code to use the DLL functions */ /* */ /* I'll use the DLL functions, statically bound in the program, to */ /* set a funtion pointer in that program which */ /* is resolved to hello() in the service program.... */ /* */ /*********************************************************************/ #include #include "dll.h" void main() { HMODULE hDLL; /* handle to the 'HELLO' DLL (service program) */ FARPROC fp_hello; int i=1; /* test integer */ hDLL = LoadLibrary("MYLIB/HELLO"); fp_hello = GetProcAddress(hDLL, "hello"); fp_hello(&i); /* dynamic linked test */ printf("main: i = %d \n", i); FreeLibrary(hDLL); }