1

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
  • I'm using Visual Studio 2010. Commented Oct 5, 2010 at 0:01

1 Answer 1

4

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.

Sign up to request clarification or add additional context in comments.

1 Comment

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.