Vb6 项目文件和源安全

发布于 2024-08-24 09:14:19 字数 275 浏览 5 评论 0原文

我正在开发的应用程序的一部分是旧版 Vb6 Windows 窗体应用程序。除 Vb6 项目文件外,项目中的所有文件均受源代码管理 (VSS) 控制。从我从从事该项目的其他开发人员那里可以了解到,其原因是项目中使用的 com 组件在每个开发人员计算机上都有不同的引用。我想将项目文件移动到 VSS 中,以便当文件添加到项目中时,可以在项目文件中更新这些文件,并且其他开发人员(更重要的是自动构建脚本)可以从源安全获取最新的项目文件。

有谁知道我是否/如何能够以不破坏不同开发机器上其他 com 组件的引用的方式实现这一点?

A part of the application that I am working on is a legacy Vb6 Windows forms application. All the files in the project are under source control (VSS) except the Vb6 project file. From what I can establish from the other developers working on the project the reason for this is that the com components used in the projects have different references on each developers machine. I want to move the project files into VSS so that when files are added to the project these can be updated in the project files and other developers (and more importantly an automated build script) can get the latest project files from source safe.

Does anyone know if/how I can achieve this in such a way as to not corrupt the references to other com components on different development machines?

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

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

发布评论

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

评论(3

强辩 2024-08-31 09:14:19

我不同意你同事的观点。如果每个开发人员都需要在他们的计算机上使用不同的引用,我敢打赌您一定会遇到一些奇怪的 COM 类型用法。您很可能将 CoClass 类型和 Interface 类型编译到您的 dll 中。

COM 就是将接口与实现分离(尽管 VB6 最好通过为每个 CoClass 创建默认接口并且不告诉您它们来消除这一点)。将您的类型移至 TLB 类型库并在您的项目中引用它。让每台机器上的COM注册处理实例化哪些具体类;这就是它的用途。

如果您的团队在处理 COM 引用方面遇到困难,那么可能是更深层次的问题。

I don't agree your colleagues. If each developer requires different references on their machine I am willing to bet you've got some strange usage of COM types going on. Most likely you have CoClass types and Interface types compiled into your dlls.

COM is all about separating interface from implementation (even though VB6 does it's best to undo that by creating default interfaces for each CoClass and not telling you about them). Move your types into a TLB type library and reference that in your projects. Let the COM registration on each machine handle what specific classes are instantiated; that's what it is there for.

If your team is struggling with COM references this much something deeper is wrong.

一袭水袖舞倾城 2024-08-31 09:14:19

长话短说,不。

真正的问题是开发人员没有从同一个地方获取他们的 COM 组件,要么是因为他们在本地编译它们,要么是因为他们获取了同一组件的不同版本。如果 COM 对象没有持续开发,真正的解决方案是让所有开发人员安装他们所需的相同版本的组件。

Long story short, no.

The real problem is that developers are not getting their COM components from the same place, either because they are compiling them locally, or they are obtaining different versions of the same component. If the COM objects are not in constant development, the real solution is to have all the developers install the same version of the components they need.

别闹i 2024-08-31 09:14:19

您需要维护一个描述您的开发项目文件夹结构的标准。例如,我总是建议创建一个替代驱动器 SUBST。例如 SUBST H: C:\DEV_\APP\Visual Studio 2008。这允许开发人员将他的东西放在他需要的地方。在这个“新”驱动器中,我推荐一个“系统”文件夹。每个 COM 对象和依赖项都放置在一个子文件夹中。所有项目仅从 H:/System/ 引用 COM 对象。不同的 COM 版本会进入一个新文件夹,并将版本作为文件夹名称的一部分。例如,C:\DEV_\APP\DEV\SYSTEM\Iocomp 和 C:\DEV_\APP\DEV\SYSTEM\Iocomp2。

(不要忘记从正确的路径(“新”驱动器)注册 COM 对象。)

我在启动时使用批处理文件来设置四个不同的开发驱动器。

使用 SUBST 的好处是,您可以签出到不同的文件夹,然后为该文件夹创建一个“H”驱动器,一切正常。

我从1996年开始就使用这个技术,效果非常好。我从来没有遇到任何问题。最困难的部分是让其他人了解这项技术。

You need to maintain a standard that describes your development projects folder structure. For instance, I always recommend creating a substitue drive SUBST. Such as SUBST H: C:\DEV_\APP\Visual Studio 2008. This allows the developer to put his stuff where he needs. In this "new" drive, I recommend a "system" folder. Each COM object and dependencies are placed into a sub-folder. All project reference the COM objects only from H:/System/. Different COM versions go into a new with the version as part of the folder's name. For instance, C:\DEV_\APP\DEV\SYSTEM\Iocomp and C:\DEV_\APP\DEV\SYSTEM\Iocomp2.

(Don't forget to register the COM objects from the correct path, the "new" drive.)

I use a batch file on startup to set four differnt development drives.

The nice thing about using SUBST, is you can check-out to a different folder then create an "H" drive to that folder and everything works.

I been using this technique since 1996 to very good effect. I never have any problems. The hardest part is getting others introduced to the technique.

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