Sign in to follow this  
Raeldor

Wrapping Unmanaged Code in .NET

Recommended Posts

Hi All, I have written an engine in C++ and want to call it from a .NET application. Are there any tools that automatically wrap the c++ classes into C# classes so I can just use them as I would any C# class? Thanks Rael

Share this post


Link to post
Share on other sites
I don't know of any tools to automatically do what you're talking about, but you can create a managed C++ class library to expose whatever you want. Or if you expose your engine as COM objects, managed languages should be able to interface with it also.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
i remember having seen a tool some day that can be used to describe a native c++ (dll) interface and create managed wrapper code for it.

one thing i'd like to contribute is this link:
http://cache-www.intel.com/cd/00/00/21/93/219300_interop.pdf

it's a paper by intel detailing how to wrap their IPP (intel performance primitives) which are a set of native C functions in C#. The paper also gives a little bit of info about other ways of doing this (c++/cli wrapper, com callable wrappers). it contains a wealth of links. the .net marshaller is described in somewhat more detail which - to a degree - also applies when you're "only" using c++/cli to wrap your engine.
it's a starting point.

i'll keep looking for this tool i mentioned.. but i think the vast majority of people use some kind of c++/cli IJW ("it just works") wrapper to expose some managed classes.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
also: recommended reading for creating managed wrappers in c++/cli:
http://www.courseptr.com/downloads/bonus/009638_BonusCh02.pdf
got me started in the "interop world".

Share this post


Link to post
Share on other sites
Thanks guys. SWIG looks interesting, I'll definitely take a better look at that. I'm kind of on the fence at the moment whether to wrap my classes or to just use MFC to write my windows interface stuff.

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