"Ratan" <Ra***@discussions.microsoft.com> wrote in message
news:54**********************************@microsof t.com...
We have a .NET library having .NET remoting based programming interface
developed using VC++.NET (VS 2005 Beta2).
We want to provide C interface for a legacy application. Is it possible?
If yes, what would be the best approach?
You can use the assembly registration (regasm) utility
http://msdn.microsoft.com/library/de...lregasmexe.asp
to "create" a COM object and type library from your .Net classes. Your C
application makes use of your .Net classes just as it would any other COM
object. I sketched the procedure with a toy .Net class and a C++ caller
here:
http://groups.google.com/group/micro...7cc21dc2b67f3d
If C++ rather than C is an option you can create an unmanaged C++ class (or
classes) which has one public method for every method of every class in your
..Net solution. Then the C++ application can use the "it just works" method
of interop
http://msdn.microsoft.com/library/de...nunmancode.asp
so that every call to one of these unmanaged methods is implemented by
calling on the corresponding managed method.
Regards.
Will