64 bit C# with a 32 bit VB6 COM object(带有 32 位 VB6 COM 对象的 64 位 C#)
问题描述
我有一个 32 位进程内 STA VB6 dll.很遗憾,我对此无能为力.我的 C# 组件极大地受益于 64 位.无论如何从我的 64 位进程调用/接口这个 32 位 dll 吗?任何形式的包装或任何东西?
I have a 32 bit in-proc STA VB6 dll. I sadly cannot do anything about this. My C# component greatly benefits from being 64 bit. Is there anyway to call/interface with this 32-bit dll from my 64 bit process? Any sort of wrapper or anything?
推荐答案
没有直接的方法可以做到这一点.
There's no direct way you can do this.
由于您无法移植 VB6 inproc dll,我建议您编写一个 32 位进程外服务器,该服务器实现相同的接口并将其委托给 VB6 代码.然后,您的 64 位应用程序可以调用进程外服务器,因为 COM 将负责在进程之间封送类型.
Since you can't port the VB6 inproc dll I'd suggest you write a 32bit out of process server that implements the same interfaces and have it delegate down to the VB6 code. Then, your 64bit app can call the out of process server as COM will take care of marshaling the types between the processes.
它不漂亮,它会工作!
这篇关于带有 32 位 VB6 COM 对象的 64 位 C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:带有 32 位 VB6 COM 对象的 64 位 C#


- 如何用自己压缩一个 IEnumerable 2022-01-01
- C#MongoDB使用Builders查找派生对象 2022-09-04
- C# 中多线程网络服务器的模式 2022-01-01
- 良好实践:如何重用 .csproj 和 .sln 文件来为 CI 创建 2022-01-01
- 输入按键事件处理程序 2022-01-01
- 带有服务/守护程序应用程序的 Microsoft Graph CSharp SDK 和 OneDrive for Business - 配额方面返回 null 2022-01-01
- MoreLinq maxBy vs LINQ max + where 2022-01-01
- Web Api 中的 Swagger .netcore 3.1,使用 swagger UI 设置日期时间格式 2022-01-01
- WebMatrix WebSecurity PasswordSalt 2022-01-01
- 在哪里可以找到使用中的C#/XML文档注释的好例子? 2022-01-01