Before starting a Simple MAPI messaging session you need to initialize your client application. This involves checking the computer's WIN.INI file to determine if Simple MAPI is available, loading the correct dynamic link library (DLL) that contains the Simple MAPI functions, and setting a pointer to each function.
hlibMAPI = LoadLibrary("MAPI.DLL"); // 16 bit clients
hlibMAPI = LoadLibrary("MAPI32.DLL"); // 32 bit clients
The two DLLs for Simple MAPI are MAPI.DLL for 16-bit clients and MAPI32.DLL for 32-bit clients.
lpfnMAPILogon = (LPFNMAPILOGON) GetProcAddress
(hlibMAPI, "MAPILogon")))
Similarly defined constants exist for the other Simple MAPI functions, so you simply need to set the value of the function pointers using the Win32 function GetProcAddress as in the previous example.