项目引用不断恢复
我有 3 个 .vbp 项目,它们属于一个组。
我能够制作 3 和 2 的 dll,当我想制作 1 的 dll 时。
我将 1 的项目引用设置为项目 2 的正确 dll。
但是,当我保存更改并重新打开 vbg 文件时。我更改的引用未显示,并且它恢复为 dll 的其他版本。
我没有在 COM 工作过,我无法继续前进。 非常感谢任何意见或支持。
I have 3 .vbp projects that are part of a group.
I am able to make dll of 3 and 2 and when I wanted to make the dll of 1.
I am setting the project reference of 1 to the correct dll of project 2.
However, when I save the changes and re open the vbg file. The reference that I have changed is not shown and it reverts back to someother version of the dll.
I havent worked in COM and I am unable to move forward.
Any input or support is highly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当您引用 ActiveX 或 COM DLL 和 EXE 时,您几乎无法控制实际使用哪个 DLL 或 EXE 文件,因为 VB6 严格根据 GUID 和 Windows 注册表工作。使用 VB6 和 ActiveX 并保持理智的关键是了解二进制兼容性。 (请参阅http://www.vbsight。 com/BinaryComp.htm )。
以下是我对 ActiveX/COM 项目(无论是 EXE、DLL 还是 OCX)的建议:
(1) 了解二进制兼容性设置。
(2) 最好为参考可执行文件添加 .cmp 后缀,例如 Project1.dll.cmp。当您查找二进制兼容性时,您就会明白我的意思。
(3) 在 VirtualPC 中开发 VB6 ActiveX 项目; VB6 ActiveX 开发对 Windows 注册表造成了很大的磨损。
(4) 当VB有理由定位一个ActiveX对象时,Reference=设置中的DLL/EXE/OCX的文件路径将会改变;它将与在注册表中找到的任何内容一起使用(最新注册的获胜)。此外,还有“升级 ActiveX 控件”设置可以进行更改的项目属性。
(5) 您几乎无法控制 VB6 将生成的 GUID 或类型库,除非通过适当的二进制兼容性管理可以达到一定程度。
When you reference ActiveX or COM DLL's and EXE's, you have little to no control over which DLL or EXE file actually gets used because VB6 is working strictly from the GUIDs and the Windows Registry. The key to working with VB6 and ActiveX and also keeping your sanity is to understand Binary Compatibility. (See http://www.vbsight.com/BinaryComp.htm ).
Here's my advice regarding ActiveX/COM projects (whether EXE, DLL, or OCX):
(1) Learn about the Binary Compatibility settings.
(2) It is good practice to suffix your reference executable with a .cmp, such as Project1.dll.cmp. When you look up Binary Compatibility, you'll know what I mean.
(3) Develop your VB6 ActiveX projects inside of VirtualPC; VB6 ActiveX development puts a lot of wear and tear on the Windows Registry.
(4) The file path to the DLL/EXE/OCX in the Reference= setting will change when VB has reason to locate an ActiveX object; it will go with whatever it finds in the registry (the latest to register wins). Also, there is the "Upgrade ActiveX Controls" setting the Project properties that can make changes.
(5) You have little to no control over the GUID or Type Library that VB6 will generate, except to the degree you can achieve via proper Binary Compatibility management.
如果您对在 VB6 中编译的 DLL/OCX 使用“二进制兼容性”选项,则在重新编译内容后,现有 VB6 项目中的引用将被破坏。我们经常处理这个“问题”,因此我们实施了 VB6 项目引用更新实用程序自动替换现有 .vbp 项目中对 ActiveX 的引用。该实用程序是免费且开源的,并且很可能会为处于类似情况的其他人节省大量时间。
If you use the Binary Compatibility option for the DLLs/OCXs you compile in VB6, the references in the existing VB6 projects become broken after you recompile your stuff. We dealt with this 'issue' a lot so we implemented our VB6 Project References Update Utility to replace the references to ActiveX's in exisitng .vbp projects automatically. The utility is free and open-source, and most likely, it will save much time for others in similar situations.