使用DLL中的类创建VB6应用程序,然后在构建后换出该DLL? [英] Create VB6 application using a class in a DLL, then swap out that DLL after build?

查看:71
本文介绍了使用DLL中的类创建VB6应用程序,然后在构建后换出该DLL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我的问题相对简单,我可以创建在dll中引用一个类的VB6应用程序,然后在运行时将该dll替换为另一个吗?

so my question is relatively simple, can I create VB6 application that references a class in a dll, and then substitute that dll for another at runtime?

现在我的初步猜测是……在VB6中没有机会.

Now my intial guess is... no chance in VB6.

所以我的想法转向了VB.net互操作dll.我可以在这里做,然后从VB调用interop dll吗?

So my thoughts turned to a VB.net interop dll. Could I do it in here, and then call the interop dll from the VB?

再说一次,我的猜想是…….但是如果有人知道的不同,我会很高兴.

Again, my guess would be no.... but I'd be happy if someone knew differently.

我认为真正可行的唯一方法是.Net中的DI,但我只能将.net 2或3.5限制在很大的范围内,所以我不知道这是否可行.

The only thing that I think would actually work would be DI in .Net, but I'm limited to .net 2, or 3.5 at a big push, so I dont know if that is possible.

因此,作为背景....

我有一个特定站点使用的dll,但我们不想将其发送给所有人.相反,我们要构建一个仅具有接口设置的克隆dll,以便VB6构建将完成.当它到达需要它的站点时,他们想要替换虚拟dll,并放下其版本.

I have a dll that a specific site uses, but we dont want to ship that out to everyone. Instead, we want to build a clone dll which just has the interfaces setup so that the VB6 build will complete. When it gets to the site that needs it, they want to replace the dummy dll, and drop in their version instead.

注意:我们在安装RegFreeCOM时确实会使用它,因此,我确实有需要的清单文件.

Note: We do use RegFreeCOM when its gets installed, so I do have the manifest files that I could play around with if needed.

任何想法都将不胜感激.

Any ideas would be much appreciated.

尼克

推荐答案

它是一个COM dll,因此只要两个DLL的类型库中的clsid和接口ID相同,它就不会静态链接到VB6 exe,您可以根据需要交换它们.(如果使用的是VB6 dll,则使用二进制兼容性"构建选项很简单)

Its a COM dll so its not statically linked to the VB6 exe, so long as the clsids and interface ids are the same in the type library for both DLLs, you can swap them around as you see fit. (If its a VB6 dll this is trivial to do with the 'binary compatibility' build option)

这篇关于使用DLL中的类创建VB6应用程序,然后在构建后换出该DLL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆