Sign in to follow this  
DarkZoulz

C++ Libraries in managed program?

Recommended Posts

DarkZoulz    106
Is it possible to link a library written in C++ to a managed program written in C#? I'm very new to C#/Managed programming. But i'd like to use it to write tools, and so I need to link my graphics engine to the C# program. Any information on this?

Share this post


Link to post
Share on other sites
Kambiz    758
You can not link directy to a c/c++ libraray but:
1)You can use DllImport; an example:
[DllImport("User32.dll")]
internal static extern int GetForegroundWindow();
2)You can write a wrapper using managed c++(c++/cli) and create a .net assembly you can use directly in c#.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this