Skip to main content
gamedev.net
🔒 Locked

C++ Libraries in managed program?

Started by DarkZoulz Mar 27, 2006 at 2:42 PM 0 replies 550+ views
Original Post
DarkZoulz
DarkZoulz
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?
Kambiz
Kambiz
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#.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.