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#
基础教程推荐
- Moq It.Is<>不匹配 2022-01-01
- 如果有人提交恶意软件Nuget包怎么办? 2022-01-01
- 当值可以是对象或空数组时反序列化 JSON 2022-01-01
- .NET SerialPort DataReceived 事件未触发 2022-01-01
- C# 从 List<List<int>> 中删除重 2022-01-01
- Azure Functions:CosmosDBTrigger 未在 Visual Studio 中触发 2022-01-01
- 如何使用 .Net 检查 Active Directory 服务器是否已启动并正在运行? 2022-01-01
- 禁止输入少量字符,例如'<'、'&a 2022-01-01
- WPF 模态进度窗口 2022-01-01
- 我应该在后面的代码中直接使用 Linq To SQL 还是使 2022-01-01
