Help with rcw wrapper for activex in visual studio .NET

tkrauskopf
tkrauskopf used Ask the Experts™
on
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
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Turns out Add Reference was the wrong place to start.

Choose Item....   from the Toolbox lets you choose any currently registered OCX and the wrappers appear automatically in References.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial