winapi – 在调用LoadLibrary()时默默捕获Windows错误弹出窗口
发布时间:2020-12-13 22:37:26 所属栏目:Windows 来源:网络整理
导读:是否有可能在调用LoadLibrary()时静默捕获错误弹出窗口,例如“过程入口点xxx无法位于动态链接库xxx中”? 解决方法 您可以通过调用 SetErrorMode()来抑制错误弹出窗口: // GetErrorMode() only exists on Vista and higher,// call SetErrorMode() twice to
是否有可能在调用LoadLibrary()时静默捕获错误弹出窗口,例如“过程入口点xxx无法位于动态链接库xxx中”?
解决方法
您可以通过调用
SetErrorMode()来抑制错误弹出窗口:
// GetErrorMode() only exists on Vista and higher,// call SetErrorMode() twice to achieve the same effect. UINT oldErrorMode = SetErrorMode(SEM_FAILCRITICALERRORS); SetErrorMode(oldErrorMode | SEM_FAILCRITICALERRORS); HMODULE library = LoadLibrary("YourLibrary.dll"); // Restore previous error mode. SetErrorMode(oldErrorMode); 但是,对LoadLibrary()的调用仍将失败. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- 安装 – Wix返回错误“在模块中找不到CA或UI入口点”但在dl
- 是否*任何人*通过SASL / GSSAPI对Windows SVNServe进行AD /
- winapi – Win32在父窗口中捕获子窗口消息
- windows-server-2003 – 带有错误硬盘驱动器硬件的第二个域
- window10 mysql服务安装
- 如何让Windows XP在重启时自动重新连接网络驱动器?
- 使用Window的RelativeSource进行WPF绑定需要Path中的“Data
- windows-server-2008-r2 – 对Server 2008 R2 Enterprise上
- windows-8 – Expression Blend中的“星形”测量是什么?
- 如何在Windows中使用C创建可中断睡眠?