Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
506 views
in Technique[技术] by (71.8m points)

c# - 32 bit ActiveX Control in a 64 bit .NET App

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?

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...