如何创建应用程序以使用VB6中的插件? [英] how to create applications to use the plugin in VB6?

查看:118
本文介绍了如何创建应用程序以使用VB6中的插件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我使用VB6,并且需要为其创建应用程序和插件.请告诉我一种方法.您能帮我使用VB6进行演示吗?
预先感谢.

Hi all,
I use VB6 and I need to create applications and plugins for it. Please show me a way to do this. Can you help me with a demo using VB6.
Thanks in advance.

推荐答案

[ ^ ]可能会有所帮助.
This[^] might help.


检查 MSDN [编写基于插件的应用程序
Check the MSDN[^]. If you can''t create a simple application, extending one will be problematic.


Writing Pluginbased Applications


如果您想要100您必须使用COM的%VB6解决方案.在一个VB6 DLL中定义COM接口,然后应用程序引用该DLL.现在,您编写的所有插件也将是实现此DLL的COM DLL.然后,该应用程序通过COM界面加载这些插件.插件可能需要添加到特定的注册表项,以便父应用可以枚举它们.

如果VB6和C/C ++的组合适合您,那么您可以使用基于C的插件模型.只需在C DLL中导出一些众所周知的(预定的)函数名(函数导出),然后VB6可以P/调用这些DLL并调用这些众所周知的函数(P/Invoke不是正确的术语,我忘记了什么它曾经在VB6中被称为).
If you want a 100% VB6 solution you''d have to use COM. Define the COM interface in one VB6 DLL, and then app references this DLL. Now any plugins you write will also be COM DLLs that implement this DLL. The app then loads these plugins via the COM interface. The plugins may need to be added to a specific registry key so the parent app can enumerate them.

If a mix of VB6 and C/C++ will work for you, you can have a C based plugin model. Just export some well-known (pre-decided) function names in the C DLLs (function exports), and then VB6 can P/Invoke these DLLs and invoke these well known functions (P/Invoke is not the right term, I forgot what it used to be called in VB6).


这篇关于如何创建应用程序以使用VB6中的插件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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