64 位 .NET 应用程序中的 32 位 ActiveX 控件 [英] 32 bit ActiveX Control in a 64 bit .NET App

查看:39
本文介绍了64 位 .NET 应用程序中的 32 位 ActiveX 控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个 C#.Net 应用程序,我希望能够为所有 CPU"编译它.我还想在此应用程序的 UI 中包含特定的 ActiveX 控件,但我尝试使用的 ActiveX 控件不支持 32 位.我可以使用一些技巧或解决方法来使用此控件吗?

I'm creating a C#.Net application which I want to be able to compile for "All CPUs". I also want to include a specific ActiveX control in the UI of this app, but the ActiveX control I'm trying to use does not support 32 bit. Is there some trick or work around I can use to use get this control to work?

在 Web 浏览器控件中嵌入 ActiveX 控件怎么样?这还能用吗?

What about embedding the ActiveX control in a Web-browser control? Would this even work?

推荐答案

您必须在单独的 32 位进程中运行 ActiveX 控件.这会很困难,它会有自己的窗口,不会成为 64 位进程的 UI 的一部分.尽管 SDK 文档明确禁止这样做,但您可以尝试利用 SetParent() API 函数中内置的 Windows 3 appcompat.它可能会起作用.

You have to run the ActiveX control in a separate 32-bit process. That's going to be difficult, it would have its own window that isn't going to be part of the UI of your 64-bit process. Although it is expressly forbidden by the SDK docs, you can try to take advantage of the Windows 3 appcompat built into the SetParent() API function. It might work.

你会有很多额外的麻烦,进程之间的通信已经够棘手了(你需要远程处理或 WCF),困难的部分是处理异常.一个进程轰炸与另一个幸存下来并且从不注意到有什么问题是不会很漂亮的.

You'll have lots of additional trouble, communicating between processes is tricky enough (you'll need Remoting or WCF), the hard part is dealing with exceptions. One process bombing with the other one surviving and never noticing that something is wrong is not going to be pretty.

也许平台目标选项开始听起来很有吸引力?

Perhaps the Platform Target option starts sounding attractive?

这篇关于64 位 .NET 应用程序中的 32 位 ActiveX 控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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