I know ActiveX is kind of stoneage but I have to write one... So. How do you go about writing an ActiveX object (not neccessarily a control) in C# This example http://www.c-sharpcorner.com//Code/2003/March/ActiveXInNet.asp is not a real ActiveX object it doesn't register itself in the registry. This example http://www.devhood.com/messages/message_view-2.aspx thread_id=16569 doesn't work.

How to: Write an ActiveX object in C#?
Ravi G
But is that a real COM application It should be a managed application consumed from ASP (or COM) through COM-.NET interoperability, isnt it It still requires .NET runtime to be installed on the machine, doesnt it If so it is still a managed application.
vnapoli
Amisur
I usually refer to my C# COM objects as "unmanaged C#". Not because they are, but because I created them primarily to work with unmanaged languages. I have never once used my C# COM objects in a .Net application.
emredincer
Arshad Syed
zx6r
It would be good if you could give us more context on what you are trying to acheive.
Benjamin Wulfe - MS
> But is that a real COM application
Yes
> It should be a managed application consumed from ASP (or COM) through COM-.NET interoperability, isnt it
Yes
> It still requires .NET runtime to be installed on the machine, doesnt it
Yes
> If so it is still a managed application.
Yes
This is just a matter of terminology. The fact that it requires the .NET runtime doesn't make it any less a COM object than, say, a COM object written in VB6 (which needs the VB6 runtime). COM doesn't care about the internal implementation or dependencies of a component.
ComputerJy
> That is not building ActiveX component in C#...
Yes it is. The link is to the article "Exposing .NET Framework Components to COM", which describes how to build a component using .NET managed code and consume it from an unmanaged component. The .NET component is exposed via a COM-Callable Wrapper (CCW)
> consuming an ActiveX component from C# through COM-.NET interoperability
This is also possible of course. In this case .NET clients call unmanaged COM components via a runtime callable wrapper (RCW). There is a different article that describes this: http://msdn.microsoft.com/library/en-us/cpguide/html/cpconexposingcomcomponentstonetframework.asp
Xee
This example shows how to do it: http://www.codeproject.com/cs/miscctrl/exposingdotnetcontrols.asp df=100&forumid=2373&exp=0&select=1359005
Sabrecat
> I dont think you can build ActiveX controls in C# since ActiveX is based on COM.
Sure you can. A good starting point is http://msdn.microsoft.com/library/default.asp url=/library/en-us/cpguide/html/cpconexposingnetframeworkcomponentstocom.asp