469,934 Members | 1,509 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,934 developers. It's quick & easy.

How do you create an ActiveX control at run-time (no form)?

Can anyone tell me how to create at ActiveX control ar run-time in code
without using a form? I want to instantiate and use the control from within
a non-visual class.

Please help!

Thanks in advance,

Jink
Nov 15 '05 #1
1 1764
Here's what you can try:

1) Reference the DLL containinf the ActiveX as a COM dll. An interop
assembly will be created and added to the project references.
2) Examine the generated assembly with Object Browser to find out which
class corresponds to the control (usually it is named AcmeControlClass if
the control itself is named AcmeControl).
3) Create an instance of that class with the "new" operator.

However, it actually depends on the control itself whether you will be able
to use it in the intended way or not. If all the control code assumes it is
visible, has a window and bounds etc., your attempt will most likely fail.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Jink Welby" <ji*******@hotmail.com> wrote in message
news:Oc**************@TK2MSFTNGP11.phx.gbl...
Can anyone tell me how to create at ActiveX control ar run-time in code
without using a form? I want to instantiate and use the control from within a non-visual class.

Please help!

Thanks in advance,

Jink


Nov 15 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Craig Pennington | last post: by
1 post views Thread by MrKrich | last post: by
1 post views Thread by sekar.rangasamy | last post: by
3 posts views Thread by Supriya | last post: by
1 post views Thread by JUN | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.