0xC0020001:字符串绑定无效。 - 只发生在WPF [英] 0xC0020001: The string binding is invalid. - Only occurring in WPF
问题描述
首先,我也许应该说,我可能是在5级水平这个东西......我使用的是C ++在WPF应用程序加载项。每当我试图退出程序时,我得到这个错误:
在Raptor.exe 0x770d15de未处理的异常:0xC0020001:字符串绑定是无效的。
我一直在使用这种博客条目尝试并计算问题出来了,但我有没有运气。有一件事我注意到,虽然,当我使用相同的C ++插件在控制台应用程序,调用许多在WPF应用程序中使用同样的方法,在控制台退出没有问题。
我也通过C ++代码消失了,找不到地方做声明一个静态变量。有静态方法虽然。 !
任何帮助将非常感激。
编辑:我启用了一些调试功能,看看这个休息。它是基于以下的最后支架打破sp_counted_impl.hpp文件(增强):
虚拟无效的Dispose()//不抛出
{
#如果定义(BOOST_SP_ENABLE_DEBUG_HOOKS)
的boost :: sp_scalar_destructor_hook(px_,sizeof的(X),这一点);
#ENDIF
的boost :: checked_delete(px_);
}
这发生在不与本地库链接,因此他们的DllMain不初始化一些必要的本地子系统(如CRT或ATL)某些DLL文件。听起来像是你有某种形式的混合模式DLL。一个推荐的解决方案是从托管DLL删除入口点:
。删除托管DLL的入口点
- 链接与/禁止入内。在Solution Explorer中,用鼠标右键单击该项目
节点,然后单击属性。在属性页对话框中,单击
链接器,单击命令行,然后将此开关添加到
附加选项字段。 - 链接MSVCRT.LIB。在属性页对话框中,单击链接器,
单击输入,然后添加到MSVCRT.LIB的附加依赖
属性。 - 删除nochkclr.obj。在输入页面(同一页在上一步骤),从附加依赖属性nochkclr.obj删除。
- 链接在CRT。在输入页面(同一页在上一步骤),__DllMainCRTStartup @ 12添加到强制符号引用属性。
更多细节可以在这里找到: https://support.microsoft.com/en-us/kb/ 814472
First off, I should probably say that I'm probably at a grade 5 level with this stuff... I'm using a C++ add-in in a WPF application. Whenever I try to exit the program, I get this error:
Unhandled exception at 0x770d15de in Raptor.exe: 0xC0020001: The string binding is invalid.
I've been using this blog entry to try and figure the problem out, but I'm having no luck. One thing I noticed though, when I use the same C++ addin in a Console application, calling many of the same methods used in the WPF application, the Console exits without a problem.
I've also gone through the C++ code and cannot find a single static variable declared anywhere. There are static methods though.
Any help would be much appreciated!
EDIT: I enabled a number of debugging features to see where this breaks. It was breaking the sp_counted_impl.hpp file (Boost) on the last bracket of the following:
virtual void dispose() // nothrow
{
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
boost::sp_scalar_destructor_hook( px_, sizeof(X), this );
#endif
boost::checked_delete( px_ );
}
This occurs with certain DLLs that don't link with native libraries and thus their DllMain does not initialize some needed native subsystem (like CRT or ATL). Sounds like you have a mixed-mode DLL of some sort. One recommended solution is to remove the entry point from the managed DLL: Remove the Entry Point of the Managed DLL
- Link with /NOENTRY. In Solution Explorer, right-click the project node, click Properties. In the Property Pages dialog box, click Linker, click Command Line, and then add this switch to the Additional Options field.
- Link msvcrt.lib. In the Property Pages dialog box, click Linker, click Input., and then add msvcrt.lib to the Additional Dependencies property.
- Remove nochkclr.obj. On the Input page (same page as in the previous step), remove nochkclr.obj from the Additional Dependencies property.
- Link in the CRT. On the Input page (same page as in the previous step), add __DllMainCRTStartup@12 to the Force Symbol References property.
More detail can be found here: https://support.microsoft.com/en-us/kb/814472
这篇关于0xC0020001:字符串绑定无效。 - 只发生在WPF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!