chris misztur

Generic Addin Infrastructure

Discussion created by chris misztur on Apr 30, 2010
Latest reply on May 28, 2010 by chris misztur

I wanted my add-in to be just the UI handler for the add-in.  I want my business logic to be separate from the add-in implementation.  I was able to accomplish this by taking advantage of  swPropertyManagerPageControlType_e.swControlType_ActiveX.

 

I created a Windows Control project in C#.  Tagged it with a ProgId and made it ComVisible, just like the add-in itself.  Then I found an article on CodeProject to help with the ComRegisterFunctionAttribute and ComUnregisterFunctionAttribute tagged methods.  The project's Build option "Register for COM interop" had to also be checked so that the dll would register itself as an ActiveX control ( however all that works... )  My project consists of a UserControl with the almighty and powerful PropertyGrid control.  I can now add: UITypeEditors, TypeConverter, TypeDescriptors to really interact with my models!

 

It also looks like the custom UserControl provides its endpoints through interfaces.  I tried this (myActiveX.uc1)activex1.GetControl()) without the interface myInterface and I got a C# exception.

pg.JPG

 

Attached is the VS2010 solution.

Attachments

Outcomes