带有 32 位 VB6 COM 对象的 64 位 C# [英] 64 bit C# with a 32 bit VB6 COM object

查看:34
本文介绍了带有 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#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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