Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 297
  • Last Modified:

call .net assembly from native c++

Hi all,

I would like to call a .net assembly from my C++ application, like "System.Data".
Is that possible, and if yes, then how?
2 Solutions
Technically speaking that's possible using COM/Interop (http://msdn.microsoft.com/en-us/library/sd10k43k%28v=vs.110%29.aspx) using the .NET objects like COM objects. Yet I'd rather evaluate if it wasn't worthwile to choose a homogeneous setup if possible.
It is possible in Windows environment when using Visual Studio C++. The compiler uses the extension of the C++ language for "managed" code. Search for the "managed native interoperability" -- you get for example here http://msdn.microsoft.com/en-us/library/zbz07712.aspx

When done correctly, using the .NET component from a native code should be seamless. However, I do not have first hand experience (programming in native only).
trustworthyAuthor Commented:
It's gruesome, but it works. Or seems to work. thank you

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now