Add ActiveX at runtime

  • Thread starter Thread starter Development
  • Start date Start date
D

Development

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?
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top