i want to know that whether i can integrate a c# project to a c++
project. i know that one of the way is to create a c# dll and call
the c# dll function in the c++ project. however, i dont know the
exact way to do it. Do any suggestion ?? thanks.
----------------------------------------------------------
----------------------------------------------------------
color]
You can't do this directly with C# afaik but you have a couple of
options...
1./ The simplest, and the recommended way is to use COM, export your C#
class as a COM class and call the method you need
2./ You can use a mechanism called reverse p/invoke, C# does not
support this directly, but it is a feature of the CLR, in order to do
it from C# you would need to write your C# code, disassemble it (using
ildasm or similar) , make some minor changes to the assembly manifest
and re-assemble (using ilasm or similar) this is a process refered to
as "creative round tripping" there is an interesting article here
www.blong.com called .NET interoperability : .NET <-> Win32 and the
book ".NET and COM the complete interoperability guide" also covers
this mechanism.
There is one other option available to you, which is, if you are not
tied to C#, you can export from a "Delphi for .NET" assembly, or from
managed C++
Rgds Tim.