is it possible to create Activex Component using c#.net? If yes then how to create it?<EOM>

  • Thread starter Thread starter B Deepak
  • Start date Start date
No it's not possible to author ActiveX controls in C#, there is however a
possibility to 'expose' Window Forms controls as ActiveX controls through
the CLR COM interop layer. Note that while the CLR doesn't offer all
features of "full controls "(see OC96 specs.) WF controls can be exposed as
ActiveX controls in ActiveX containers like IE and Office.


Willy.
 
Hi Willy,

Do ur workaround allow me to fire regsvr32 command on the dll?
If yes, then I have to use this registered dll as excel RTD server.

Waiting for reply...
Thanks,
Deepak
 
You don't need regsvr32, you need to include the functions to register the
UC as an "AX control" in the registry as explained in the article pointed to
by Ollie, when done you should register the assembly as COM callable using
regasm.exe, or by setting the project property "register for COM interop".
Note that exposing .NET to COM clients requires .NET to be installed!.

Willy.
 
Hi Willy,

Thanks for your valuable help.
I simply created a class library in c# project and inside configuration
prpoerties tab, i checked for "register for COM interop".
Does it solve my pb? Because I have to create a "excel RTD server" and for
this dll should be of activex dll type.

Regards,
Deepak
 
B Deepak said:
Hi Willy,

Thanks for your valuable help.
I simply created a class library in c# project and inside configuration
prpoerties tab, i checked for "register for COM interop".
Does it solve my pb? Because I have to create a "excel RTD server" and for
this dll should be of activex dll type.

Regards,
Deepak

If your only need is to use the RTD function in Excel, then, all you have to
do is to expose the .NET class as a COM server, and all you have to do in VS
is to register for COM interop and pay attention to the specific
requirements impossed by COM clients, please search MSDN for details on "COM
interop".

Note that this has nothing to do with "ActiveX controls", and as such has
nothing to do with the article Ollie pointed to.

Willy.
 
Back
Top