I am trying to register a winform user control as a COM server so that my MFC applications can use them. The winform control is written in C ++ / CLI and uses an unmanaged native DLL. I want to use the .net awesome 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 that I can use regasm to achieve what I am doing, so I went and registered it
regasm MyAx.dll /tlb:MyAx.tlb
I even generated a registry entry
regasm MyAx.dll /regfile:MyAx.reg
and combined it with my registry
At this point, I expected this control to appear in my COM components when I select "Elements" for the toolbar. However, he does not appear there. Is this expected behavior? If so, how will I use this control in my MFC application, in fact, any language that uses the ActiveX control (say, Java).
source share