Skip to main content
GameDev.net gamedev.net
🔒 Locked

using c++ inside c#

Started by fatima Dec 25, 2011 at 4:46 PM 2 replies 1.8k views
Original Post
fatima
fatima
hi everyone
is it possible to use native c++ inside c#? for example by exporting classes to a dll and using them in c#, or any thing like c++ interfaces.
I love c++ but lack of a realy acceptable ui library(powerful and easy to use, like winforms for c#) is a disaster. combining native and managed c++ can't be a good solution.
thank you for your attention.
SiCrane
SiCrane
Yes, C++ DLLs can be called from C# with platform invoke (often abbreviated as P/Invoke or less commonly pinvoke). One thing in particular to look at is the DllImportAttribute which allows you to mark function declarations as coming from DLLs. There are other options such as creating your native C++ code as COM objects that C# can also consume or creating a C++/CLI managed wrapper for the C++ code.
fatima
fatima
thank you.
Matt-D
Matt-D
You might also be interested in CXXI: http://tirania.org/blog/archive/2011/Dec-19.html

Topic Locked

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

Sign in to reply to this topic.