简体   繁体   中英

Using ActiveX control (no associated UI) in C# / WPF app

I have gone through couple of articles on hosting active X control.

http://msdn.microsoft.com/en-us/library/ms742735(v=vs.100).aspx

I see the example uses a Windows Media Player, which is shown to the user.

My requirement is, I have an active X control, and there is no UI associated with it. There is some business logic associated with it and my application is WPF.

My doubt is should I still go for the way of using WindowsFormsIntegration for hosting the activeX control or should I simply instantiate the active X control in the helper class and use it through out the life time of my application..

Thanks Sandeep

Well hosting an ActiveX component doesn't necessarily mean displaying an ActiveX component. It is perfectly valid to have hidden elements, even if they are fundamentally visual elements, just to have access to their particular properties (and logic). Indeed many customized WPF controls are put together using a variety of visual controls which the user never actually has a clue about. I say host it discreetly in the background and use it was you will.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM