I am trying to register a winform user control as a COM Server so my MFC applications can use them. The winform control is written in C++/CLI and uses an unmanaged native dll. I want to make use of .net's terrific Interop services to register this user control as a COM server.
[ProgId("MyAx.MyAxControl")]
[ClassInterface(ClassInterfaceType::AutoDual)]
[Guid("612EAF58-ADCC-4e87-BC9E-FA208B037414")]
public ref class MyAxControl: public System::Windows::Forms::UserControl
MSDN said I can use regasm to achieve what I am doing, so I went ahead and registered it
regasm MyAx.dll /tlb:MyAx.tlb
I even generated a registry entry
regasm MyAx.dll /regfile:MyAx.reg
and merged it with my registry
At this point I had expected that this control will show up in my COM Components when I go choose Items for the tool box. However it ain't showing up there. Is this an expected behavior ?. If yes, how will I use this control in my MFC application, for that matter any language that consumes an Activex control (say Java).