在使用 Direct sound 时,会弹出下面的信息,如果一直按 VS 中的运行,程序会一直运行下去的,即下面的这个异常似乎可以去掉。
DLL 'bin/Debug/Microsoft.DirectX.DirectSound.dll' is attempting managed execution inside OS Loader lock. Do not attempt to run managed code inside a DllMain or image initialization function since doing so can cause the application to hang.
至于为什么会出现这个异常,看到某个人的解释是 MS的 Bug,不过可以不显示这个异常,具体方法如下:
菜单栏中的 调试 --> 异常,在弹出的窗口中,把
Managed Debugging Assistants 下的 LoaderLock 的 复选框的勾去掉
参考: http://www.pcreview.co.uk/forums/thread-3741011.php
DLL is attempting managed execution inside OS Loader lock 解决
本文介绍在使用DirectSound时遇到的DLL异常问题及其解决方法。该异常与尝试在OS加载锁内部执行托管代码有关,可能导致应用程序挂起。文章提供了一个简单的步骤来禁用异常通知,避免程序运行时出现警告。

被折叠的 条评论
为什么被折叠?



