Article ID: 111610
Article Last Modified on 10/29/2003
{
HINSTANCE hDLL;
UINT uOldErrorMode;
uOldErrorMode = SetErrorMode(SEM_NOOPENFILEERRORBOX);
// Try to load DLL.
hDLL = LoadLibrary("MYDLL.DLL");
if (hDLL == 2)
MessageBox(NULL, "MYDLL.DLL does not exist", "ERROR", MB_OK);
else if (hDLL <= HINSTANCE_ERROR)
MessageBox(NULL, "Other problems loading MYDLL.DLL, "ERROR", MB_OK);
else
{
MessageBox(NULL, "MYDLL.DLL exists", "SUCCESS", MB_OK);
FreeLibrary(hDLL);
}
SetErrorMode(uOldErrorMode); // Can restore error mode if desired.
}
Additional query words: 3.00 3.10
Keywords: kb16bitonly KB111610