Re: Using legacy C/C++ code with C#
- From: "Peter Duniho" <NpOeStPeAdM@xxxxxxxxxxxxxxxx>
- Date: Thu, 12 Jun 2008 17:39:26 -0700
On Thu, 12 Jun 2008 17:14:24 -0700, Bit Byte <root@xxxxxxxxxxx> wrote:
I have legacy code I wrote in C (and some C++). What is the recommended way to use my legacy code from C# ?
It really depends on the code. IMHO, the best way is to just port it and abandon the original. :)
But sometimes you'd prefer to stick with the original (for example, it's still used elsewhere and you only want to maintain one code base).
In that case, your two main options are to compile it to a DLL and use p/invoke, or wrap the code in managed C++ and produce a managed DLL directly usable from C#. The latter is basically the same as the former, but more explicit. In other words, it could be more work, but you have more control over the resulting interface too.
Pete
.
- Follow-Ups:
- Re: Using legacy C/C++ code with C#
- From: Kenneth Porter
- Re: Using legacy C/C++ code with C#
- References:
- Using legacy C/C++ code with C#
- From: Bit Byte
- Using legacy C/C++ code with C#
- Prev by Date: Re: string s=""+(char)34; != Chr(34) and also != \" etc.
- Next by Date: Re: How do I change careers?
- Previous by thread: Using legacy C/C++ code with C#
- Next by thread: Re: Using legacy C/C++ code with C#
- Index(es):
Relevant Pages
|