The information in this article applies to:
SUMMARYWhen explicitly loading a dynamic-link library (DLL) using LoadLibrary(), Windows will display a "file error" message box with the error where MYDLL.DLL is the name of the DLL specified in LoadLibrary() before returning from LoadLibrary() if the DLL does not exist in the Windows path. For more information about the Windows path, see the Windows search order described in the documentation for LoadLibrary(). It is possible to suppress this error message so that a custom error message or other error handling may be implemented without this system error box. To do so, call SetErrorMode() with SEM_NOOPENFILEERRORBOX before the call to LoadLibrary(). LoadLibrary() will return error code 2 meaning "File was not found." MORE INFORMATION
SetErrorMode() only affects the error mode of the current task and does not
affect the entire system. The return value may be used to toggle the error
mode in different portions of an application.
From File Manager, no "file error" message box appears, but the following message is displayed instead: Because these error messages appear before the WinMain() of the application executes, SetErrorMode() cannot suppress the error message boxes for implicitly linked DLLs. Furthermore, there is no way to configure Program Manager to suppress the "file error" message box. Sample Code
Additional query words: 3.00 3.10
Keywords : kb16bitonly |
Last Reviewed: November 4, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |