Using .NET with big C program?
-
Hi, I have been trying to figure out, is it possible to use .NET-classes with massive C-program in restricted cases? The program is compiled with Visual C++ - compiler. Converting the whole program to C# is out of question, so is it possible to use .NET only occasionally? :confused:
-
Hi, I have been trying to figure out, is it possible to use .NET-classes with massive C-program in restricted cases? The program is compiled with Visual C++ - compiler. Converting the whole program to C# is out of question, so is it possible to use .NET only occasionally? :confused:
No, unfortunately C compiles to native code, wheras .NET compiles into MSIL before being run. This means that .NET classes are completely unaccessable by C. What are you looking to do? is there no native method to do the same operation?
-
No, unfortunately C compiles to native code, wheras .NET compiles into MSIL before being run. This means that .NET classes are completely unaccessable by C. What are you looking to do? is there no native method to do the same operation?
That is not completly true C# and C++ can talk, in COM language. You can compile one site into COM and then share it as components. Greetings, Felipe
-
Hi, I have been trying to figure out, is it possible to use .NET-classes with massive C-program in restricted cases? The program is compiled with Visual C++ - compiler. Converting the whole program to C# is out of question, so is it possible to use .NET only occasionally? :confused:
-
Thanks for advice, I guess I'll have to try some other approach. It's just that .NET has some neat features, I'd like to use..
C# syntax is very similar to other languages, if you could just object-orient your C code, even very crudely it may be worth the swap... - and you can access WinAPI calls from .NET languages.
-
Hi, I have been trying to figure out, is it possible to use .NET-classes with massive C-program in restricted cases? The program is compiled with Visual C++ - compiler. Converting the whole program to C# is out of question, so is it possible to use .NET only occasionally? :confused:
As the others have posted, you can use COM interop, but you may get better results using the .NET Hosting APIs. For information, see "Hosting Interfaces.doc" under the .NET Framework SDK directory (typically C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Tool Developers Guide). See also What Is CLR Hosting[^]. Stability. What an interesting concept. -- Chris Maunder