I have two levels of question as I am trying to learn how to wrap an unmanaged ActiveX object for use in a WPF/C# application.
1. When you Add Reference to an OCX in a Visual Studio application, VS automatically generates Interop.blah and AxInterop.blah methods which form what they call an RCW to wrap the Active X. Sometimes it only creates Interop.blah and not AxInterop.blah -- does anyone know what triggers one or the other and how to force it to create both? My theory is that anything used as a Form Control gets AxInterop.blah but I can't find that documented anywhere.
I ask because I have a third party library (www.portsip.com
) that doesn't seem to work when wrapped with Interop.blah, but does work when wrapped with AxInterop.blah. And VS only generates Interop.blah when I add the library. It does not have any Form Control support, it is a networking library.
How do I know this? Their sample program works, but mine doesn't.
2. I think I can adapt the sample app if I can create a fake form control. Any pointers to the minimum requirements for getting VS to recognize a form control? Is it as easy as instantiating a simple control and then replacing the guts with my imported library?
Thanks for any help.
C#/VS8/.NET framework 3.5/WPF app