将 vb6 迁移到 .net
我们即将使用现有的 SQL 数据库启动一个新项目,但该项目需要重用使用相同数据库的现有 vb6 应用程序中的许多核心功能。
我想到了两种方法:
方法 1:
将现有的 vb6 应用程序作为入口点,但立即调用 .net 类来显示主屏幕和菜单。如果用户需要使用 vb6 中的功能/表单,则向 vb6 引发一个事件以加载该表单并隐藏其 .net 端,直到完成为止。
方法 2:
与上述相反,创建一个 .net exe 作为入口点,并在需要 vb6 功能/表单时调用 vb6 dll。
由于 vb6 应用程序中进行的初始化使各种功能可用,因此我认为执行第一个选项会不那么痛苦。我想知道无论哪种方式我都应该注意是否有任何优点/缺点。
We are about to start a new project using an existing SQL DB, but this project is going to need to reuse a number of core features from an existing vb6 app that uses the same database.
Two approaches I have in mind:
Approach 1:
Have the existing vb6 application be the entry point, but immediately call a .net class to present the main screen and menu. If the user needs to use a feature/form that is in vb6 then raise an event to vb6 to load that form and hide the .net side of it until it's done.
Approach 2:
Opposite of the above, create a .net exe to be the entry point and call a vb6 dll whenever I need a vb6 feature/form.
Because of initialization that goes on in the vb6 app that makes the various features usable, I am thinking it would be less painful to do the first option. I'd like to know if there are any pros/cons I should be aware of doing it either way though.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我肯定会选择选项 2:-
如果您还没有转向 .NET,那么您应该转向 .NET,这样您就可以将 VB6 功能重写到 .NET 中,并且当您迁移所有内容后,您将留下一个新的 .NET 应用程序。
反之亦然,您将始终有一个旧版 VB6 应用程序需要在某个时候进行转换。
I would definitely go with option 2:-
You should be moving towards .NET if you are not already so this way you can re-write VB6 features into .NET and when you have migrated everything you will be left with a new .NET app.
The other way round and you will always have a legacy VB6 app to convert at some point.