2
Answers

Integrating C # into a C++ Project

Photo of kenzo

kenzo

20y
2.2k
1
Hello, I need to make an application which uses SOAP calls, so the best thing to use for this is C # I presume, but the rest of the application is written in C++. So we are only going to use the C # for the SOAP calls en methods, but still want to use C++ for the rest of the application. Is it possible to call a method from some sort of C++ object inside a C# method? Any help is very welcome. I am completely new to C # .. Thanx, Kenzo

Answers (2)

0
Photo of kenzo
NA 3 0 20y
Thanx for the reply, I will take a look at the C# library exposement to a COM object, and see where I can get from there. Normally this should be enough .. Thanx for the help Kenzo
0
Photo of spgilmore
NA 591 0 20y
The answer to your question is that it can by done, will probably be easy if you're comfortable with COM, and may be even easier than that using C++ managed extensions. Because C# is new and the .NET framework is not yet complete, such gaps in functionality are filled by interoperating with unmanaged code (like C++). This can be done by exposing .NET DLLS as COM libraries, or by calling legacy DLLS or by using COM objects from C#. To call C# code from C++, write a C# assembly (library) and expose it as a COM object. This is just a setting in the IDE. Very easy. To call C++ code from C#, put the code in a legacy DLL or COM DLL. Now that I've said all that... Visual C++ 7 has what's called "managed extensions". This means that it is a sort of hybrid. It is mainly a Win32 compiler, but can access some managed code in some ways. I don't have much information on this and have never used it.
Next Recommended Forum