平台配置之间的切换会破坏 COM 兼容性

发布于 2024-11-03 10:02:54 字数 1100 浏览 1 评论 0原文

我在使用 Visual Studio 时再次遇到一个相当奇怪的问题。我有一个依赖于一个 COM 库的库。突然,依赖于 MDAC 2.7 的 COM 库突然1产生了此编译错误:

Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY))

与此错误一起,其他错误显示在指定对象上找不到属性。经过对我的系统进行大量调查后,我发现由于某种原因,一些 MDAC 库不再注册2。手动注册它们(因为安装程序不再让我重新安装它)修复了错误,但有关未找到属性的错误仍然存​​在。归结为:

Me.prv_comObject.Value = aValuePassedIn ' This throws the error that the
                                          Property "Value" could not be found '

' This works instead: '
Me.prv_comObject.set_Value(aValuePassedIn)

现在线索来了,这只在 x86 配置中出现问题,在任何 CPU 中我仍然可以使用属性。我也无法用 SharpDevelop 重现这一点,SD 总是期待属性。我也不确定这是否与 MDDAC-Thingy 有任何关系。

这是一个VB.NET项目,COM库是VB6,操作系统是Windows XP。有什么想法可能会导致这种行为吗?

1:是的,突然。我通常是在开发,然后切换到发布模式,然后它就在那里并且不会再消失了。

2:是的,我正在摆弄 MDAC,因为我试图帮助查明问题 现已随 Windows 7 SP1 引入 (是的,我们不知道这一点)。但我并没有搞乱 MDAC 库的注册。

I have an rather odd problem with Visual Studio once more. I have a library which depends on one COM-Library. Out of the blue the COM-Library depending on MDAC 2.7 suddenly1 produced this Compile-Error:

Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY))

Together with this error others showed up that Properties were not found on the designated object. After much investigation into my system, I could figure out that for some reason some MDAC libraries were not registered anymore2. Registering them by hand (because the setup wouldn't let me reinstall it anymore) fixed the error, but the errors about the not found Properties stayed. It boiled down to this:

Me.prv_comObject.Value = aValuePassedIn ' This throws the error that the
                                          Property "Value" could not be found '

' This works instead: '
Me.prv_comObject.set_Value(aValuePassedIn)

Now comes the clue, this only breaks in x86 configuration, in Any CPU I can still use the Properties. I was also unable to reproduce this with SharpDevelop, SD is always expecting Properties. I'm also not sure if this is related to the MDDAC-Thingy in any way.

It's a VB.NET project, the COM Library is VB6 and OS is Windows XP. Any ideas what might cause this behavior?

1: Yes, suddenly. I was normally developing, then switched to Release mode and then it was there and wouldn't go away anymore.

2: Yes, I was messing around with MDAC, because I tried to help pinpoint the problem which was now introduced with Windows 7 SP1 (yes, we were unaware of that). But I did not mess around the registration of the MDAC libraries.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

乱世争霸 2024-11-10 10:02:54

在想知道那是什么之后三天,它就消失了。

我清理了项目,删除了 obj 和 bin ,突然一切都恢复正常。似乎目标文件已损坏。

After three days of wondering what that is, it is gone.

I've cleaned up the projects, removed the obj and bin and suddenly everything turned back to normal. Seems like the object files were corrupted.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文