By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,370 Members | 1,574 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,370 IT Pros & Developers. It's quick & easy.

Add ActiveX at runtime

P: n/a
I want to add an ActiveX only if it exists on the system. (For licensing
reasons).
So I want to check at runtime if a certain ocx file exists and if it does I
want to use it. Is it possible?
Nov 16 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Development,

Just because the file exists on the system doesn't mean that you can
actually use it. If it is not registered properly, then you will not be
able to use it at all.

Also, the framework (from what I can tell), doesn't provide a mechanism
to just create a Windows Forms control which hosts an ActiveX control, the
AxHost program seems to do that without exposing components to do so. In
order to host your control dynamically, you will have to run the AxImp
utility on the command line, and then dynamically load the assembly into
your app. If you want to call anything specific on the control, you will
have to use reflection, or cast it to an interface which you know the
control implements.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Development" <de*********@scansys.nl> wrote in message
news:eh**************@TK2MSFTNGP11.phx.gbl...
I want to add an ActiveX only if it exists on the system. (For licensing
reasons).
So I want to check at runtime if a certain ocx file exists and if it does I want to use it. Is it possible?

Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.