tags:

views:

23

answers:

1

Hi all,

I'm stuck: I just can't get my head around how to access C# methods from C++. I've got as far as working out that you need a COM server, but none of the code I've tried works.

Can anybody point me in the direction of a working project that demos how C++ can call methods from a C# library, using COM or otherwise?

+1  A: 

There is a sample with C++ calling managed code via COM on MSDN. Also a two-part tutorial (somewhat dated) here.

Play around a bit and come back with more detailed questions.

Steve Townsend
Thanks, with your help everything works well now. The problem was that I had to set the COM object to "visible" using "[assembly: ComVisible(true)]" in AssemblyInfo.cs.
Gravitas