Calling C# from VC++

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

I'm using managed VC++ with C#. How do I call a C# method from VC++

Dave A.
 
Add this to your cpp or header files(s)

#using <yourCsharpAssemblyPFilePath>;
using namespace someNamespace; //for convenience
....


Willy.
 
This all assumes that you are working with Managed C++ and not traditional
C++ so you will also need to compile with /clr.

--
-----
Sam Gentile
Microsoft MVP - C#/.NET
..NET Blog http://samgentile.com/blog/

Please do NOT contact me directly but respond to
the newsgroup instead.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top