I need to create a plug-in (with GUI) for an application that loads them as activeX components (the joy of legacy systems). I've done some googling, but while I can find multiple examples of how to create an activeX component for a web page I can't find any examples for the desktop equivalent.
+1
A:
You should start with a new Windows Forms Control Library - Project.
In the project-properties dialog, section for your application, click on [Assembly Information ...].
Then you will see a checkbox: Make assembly COM visible. Check this option on.
This is equivalent to having
[assembly: ComVisible(true)]
in AssemblyInfo.cs. All your (public) user-controls should be accessible e.g. in VB6 projects.
I didn't expect so much trouble as discussed here
The main point seems to be: regsvr32 is useless for .net-dlls. you should go with regasm.exe
ralf.w.
2010-07-04 18:28:05
When I do that on an otherwise empty project I get the warning: "C:\...\AAAAAxNetTest.dll" does not contain any types that can be unregistered for COM Interop.
Dan Neely
2010-07-06 13:45:58
what do you mean by "otherwise empty" ? at least one control should be included. maybe you renamed one of the included controls ? because I know, that every control will be registered for themselves. Last question: can you see your COM-Control in your legacy system ?
ralf.w.
2010-07-06 13:56:48
I mean it had the UserControl1 class that was created with the project, and the class isn't showing up in ActiveX Control Test Container's (a debug tool from older versions of VS that does find controls build from a demo project I found elsewhere) list of importable controls.
Dan Neely
2010-07-06 14:08:14
I think there are more helpful pointers here:http://stackoverflow.com/questions/1685320/com-interop-registration-problem
ralf.w.
2010-07-06 14:48:31
Looking at that now. My problem appears to be something at the project level since when I added a class from an example project that does register for com successfully I still get the warning.
Dan Neely
2010-07-06 14:54:25