Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Apr 21, 2013 08:11 PM by Tanaka Hiero
Mar 07, 2009 11:56 PM|LINK
Is it possible to take a C program and compile it with VS.NET and then use it just as you would another .NET compiled application, such as C#?
Mar 08, 2009 06:59 PM|LINK
you have to enable unsafe mode in .net and use pinvoke kind of stuff. Here is some pointers on that.
Mar 08, 2009 08:39 PM|LINK
What sort of C program is it?
It may be best to convert part or all of it to C#. Since C# is managed code, you will be able to simplify the code by removing memory management code such as ALLOC.
Apr 21, 2013 08:11 PM|LINK
You can't use C code directly within .NET.
You have a couple of options:
Compile the C code into a dynamic link library, and use P/Invoke in order to call it from your .NET program.
Port the C code to .NET.
Wrap the C code using C++/CLI (making a mixed mode assembly), and use these from within your other .NET language of choice