C#:调试器中的 comctl32.dll 版本 6
我正在为 TaskDialog 使用 WindowsAPICodePack 。当我尝试显示该对话框时,它说需要加载 comctl32.dll 的版本 6。所以我将版本 6 添加到 app.manifest 并尝试运行它。还是没有运气。我进入 Debug 文件夹并在没有 Visual Studio 的情况下运行该程序,它工作正常。我猜测 Visual Studio 没有使用清单文件...我想知道是否有办法让它做到这一点。
I'm using the WindowsAPICodePack for TaskDialog. When I try to show the dialog it says that it needs to load version 6 of comctl32.dll. So I added version 6 to the app.manifest and tried running it. Still no luck. I went to the Debug folder and ran the program without Visual Studio and it works fine. I'm guessing that Visual Studio isn't using the manifest file... I was wondering if there was a way to make it do this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
Robpol86,您的代码抛出 SEHExceptions,因为 ActivateActCtx 和 DeactivateActCtx 的签名不正确。对于 lpCookie,您必须使用
UIntPtr
而不是uint
。因此,EnableThemingInScope.cs 的正确代码是:
Robpol86, your code is throwing SEHExceptions, because the signatures for ActivateActCtx and DeactivateActCtx are not correct. You have to use
UIntPtr
instead ofuint
for the lpCookie.Therefore, the correct code for EnableThemingInScope.cs would be:
我最近在使用 CodePack 中的 TaskDialogDemo 调试代码时遇到了这个问题。这就是我修复它的方法。使用这个的问题是,如果我打开两个或三个对话框,它会抛出一个 SEHException,我还没有弄清楚如何修复。所以买家要小心。
添加 Core\Interop\TaskDialogs\EnableThemingInScope.cs:
然后在第 93 行的 Core\Interop\TaskDialogs\NativeTaskDialog.cs 中(上方 HResult hresult = TaskDialogNativeMethods.TaskDialogIndirect )使该部分看起来像这样(最后你将有三行新行):
I recently ran into this problem when debugging code with the TaskDialogDemo in the CodePack. This is how I kind of fixed it. The problem with using this is if I open two or three dialogs it throws an SEHException, which I haven't figured out how to fix. So buyer beware.
Add Core\Interop\TaskDialogs\EnableThemingInScope.cs:
Then in Core\Interop\TaskDialogs\NativeTaskDialog.cs on line 93 (above HResult hresult = TaskDialogNativeMethods.TaskDialogIndirect) make the section look like this (in the end you will have three new lines):
本页介绍如何向项目添加自定义清单,以便告诉 Windows 加载新的 comctl32.dll(版本 6.0):
您的清单是否对 comctl32.dll 具有正确的依赖关系?您是否嵌入了创建的清单?
This page describes how to add a custom manifest to your project in order to tell Windows to load the new comctl32.dll (version 6.0):
Does your manifest have the right dependency on comctl32.dll? Did you embed the created manifest?
我在调试模式下使用 Visual Studio 时遇到同样的问题。到目前为止我还没有找到解决方法,它在发布模式下工作得很好。
I have the same issue with Visual Studio in Debug mode. So far I haven't found a workaround, it works fine in Release mode.