Jump to content


Calling unmanaged code from managed code


2 replies to this topic

#1 Francois Hamel

    Valued Member

  • Members
  • PipPip
  • 86 posts

Posted 07 September 2004 - 10:16 PM

I'm not too experienced with C# or with the .NET platform in general. I'd like to know if it's easy enough to call unmanaged code writen in C++ in C#?

And what happens when you have to deal with pointers and char* strings as parameters instead of managed C# references and native strings?

Because right now I'd like to implement my "engine" in C++ and use C# for any GUI stuff I might need like a level editor, material editor, particle editor, etc....

Anyone got some experience to share?
I post with style, do you?
http://fhamel.blogspot.com/

#2 anubis

    Senior Member

  • Members
  • PipPipPipPip
  • 2225 posts

Posted 07 September 2004 - 10:45 PM

it's possible to mix managed and unmanaged code in c++. the unmanaged code that is written in c++ also gets compiled into IL (at least in the current .NET version. i'm uncertain wether anything changed about that in .NET 2.0). the c++ code can then be called from C# as any other .NET code. C# does support pointers although you have to specifically tell the compiler to allow it.

for reference : http://www.ondotnet..../03/mcppp2.html
If Prolog is the answer, what is the question ?

#3 bladder

    DevMaster Staff

  • Moderators
  • 1057 posts

Posted 08 September 2004 - 01:23 AM

you can check the following post:

http://www.devmaster...?showtopic=1663

Exact same question was asked.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users