Last post Apr 21, 2013 09:11 PM by Tanaka Hiero
Mar 08, 2009 12:56 AM|RobertLair|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 07:59 PM|pkellner|LINK
you have to enable unsafe mode in .net and use pinvoke kind of stuff. Here is some pointers on that.
Mar 08, 2009 09:39 PM|TATWORTH|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 09:11 PM|Tanaka Hiero|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