Click to See Complete Forum and Search --> : simple question


dvn
December 3rd, 2002, 01:20 AM
Hi there !

There is a little question and I hope that someone has the answer. How I can get an access to th C# code from C++ code ?

Thanks in advance !

MartinL
December 3rd, 2002, 05:37 AM
Do you mean Managed C++??? If so, just add reference to your C# project into the Managed C++ project. Then you are able to instantiate and use C# classis as if they are C++ classes...

If you don't mean Managed C++ then you don't have direct access to the C# code. You need to create COM object from you C# class and you can use that COM object from C++ code... For this solution look into the .NET Framework SDK Documentation at the section:

.NET Framework SDK --> Programming with the .NET Framework --> Interoperating with Unmanaged Code --> Exposing .NET Framework Components to COM.

Martin