无法在 Windows 7 中加载 VB6 OCX 错误 372
我正在开发一个使用 VB6 为 Windows XP SP3 开发的应用程序。我目前正在使其在 Windows 7 上运行,但遇到了我们的自定义 OCX 文件之一的问题。
当尝试加载包含问题 OCX 中的控件实例的表单时,会产生以下错误:
无法从 y.ocx 加载控件“x”。您的 y.ocx 版本可能已过时。确保您使用的是应用程序附带的控件版本。
我已经检查了版本号,它们都是正确的并且引用了正确的版本。 OCX 注册良好,并且所有预期的注册表项都存在。
使用 DependencyWalker 检查显示没有丢失依赖项。
该软件在 XP 下运行良好,这(似乎)是在 Windows 7 上运行时的唯一问题。
有趣的是,如果我使用 VB6 组运行 VB6 IDE(该组有问题的 OCX 部分,并且应用程序启动项目),我没有这个问题。通过 IDE 单独运行应用程序仍然会出现错误。
关于可能缺少什么会导致应用程序抛出此错误的任何想法?
Windows 7 Professional 和 Home Professional(均为 32 位)上都会出现错误。
I'm working on an application developed for Windows XP SP3, using VB6. I'm currently in the process of getting it to work on Windows 7, but am encountering a problem with one of our custom OCX files.
When attempting to load a form that contains an instance of the control contained in the problem OCX, the following error is produced:
Failed to load control 'x' from y.ocx. Your version of y.ocx may be outdated. Make sure you are using the version of the control that was provided with your application.
I've checked the version numbers and they're all correct and referencing the proper version. The OCX registers fine, and all the expected registry entries are present.
Inspection with DependencyWalker shows no missing dependencies.
The software works fine under XP, and this is (seemingly) the only issue when running on Windows 7.
Interestingly, if I run through the VB6 IDE using a VB6 group (with the offending OCX part of the group, and the application the startup project), I don't have the issue. Running the application on it's own through the IDE still presents the error.
Any ideas on what could be missing which would cause the application to throw this error?
Error occurs on both Windows 7 Professional and Home Professional, both 32 bit.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这几乎可以肯定是接口兼容性问题。 COM 接口的版本完全独立于您的主要/次要/修订号,除了安装程序使用的之外,它们只不过是注释。
在此过程中,您破坏了二进制兼容性,并且您尝试使用比编译应用程序所针对的接口更新的接口来部署库。
这些版本号可在以下键中找到:
您的程序需要删除对 OCX 的旧引用,设置新的引用,然后必须重新编译。这也意味着删除控件的任何实例并将它们一一添加回来。
我怀疑这是 Windows 7 的问题。
This is almost certainly an interface compatibility problem. COM interfaces are versioned entirely separately from your Major/Minor/Revision numbers, which are little more than comments except as used by Installer.
Somewhere along the line you broke binary compatibility, and you are trying to deploy a library with a newer interface than your application was compiled against.
These version numbers are found in keys such as:
Your program needs to have its old reference to the OCX removed, a new one set, and then it must be recompiled. This also means deleting any instances of the control and adding them back one by one.
I doubt this is a Windows 7 issue.
我怀疑这是一个UAC问题。尝试关闭UAC 看看这是否能解决当前的问题。如果是这样,那么您必须使用 '以管理员身份运行' 和/或 为您的应用程序创建清单。
I would suspect this is a UAC problem. Try turning UAC off to see if that solves the immediate issue. If it does then you have to regsiter everything using 'run as administrator' and/or create a manifest for you application.
听起来您的 OCX 中包含的某个控件出现了加载问题,而不是一般的注册错误。查看 x 控件的构造函数,看看它们是否做了任何与 UAC 等不一致的事情。调试此问题的一种方法是在初始化控件之前进行某种中断,然后从 Visual Studio 调试应用程序(请记住在 VB6 中创建 PDB),然后从中断处继续查看控件为何不运行。 t 初始化。
Sounds like on of the controls included in your OCX is having issues loading, not a general registration error. Look at the constructors for x control, and see if they are doing anything that disagrees with UAC or such. One way you can debug this is put some kind of a break before the control is initialized, and debug the application from Visual Studio (remember to create the PDB's in VB6), and then carry on from the break to see why the control isn't initializing.