32 bit ActiveX Control in a 64 bit .NET App

后端 未结 2 473
广开言路
广开言路 2020-12-21 09:33

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 Acti

2条回答
  •  青春惊慌失措
    2020-12-21 10:01

    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.

    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?

提交回复
热议问题