Click here to Skip to main content
15,669,039 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
I have a software in c++ and a software in c#, I need to interface them..I search on google but I don't fine anything

What I have tried:

i search on internet but I don't find anything, do you have some examples? thanks
Updated 22-Feb-23 2:38am
Fred van Lieshout 21-Feb-23 10:30am    
You could take a look at SWIG:
Dave Kreskowiak 21-Feb-23 10:50am    
That depends entirely on what you mean by "interface them". Are you trying to use a C++ library in a C# app? A C# library in a C++ app? Or whatever else. You're going to have to go into far more detail to get a reasonable answer.
Member 14594285 21-Feb-23 11:06am    
yes, I must use a c++ library in c# app
Member 14594285 22-Feb-23 4:10am    
sorry, it's the opposite..c# library for c++..sorry
Gerry Schmitz 21-Feb-23 11:02am    
If you're not in a hurry, maybe transfer a file between them.

I must use a c++ library in c# app
For a non-NET C++ Executable (EXE or DLL) you use the DllImportAttribute Class (System.Runtime.InteropServices) | Microsoft Learn[^]
Share this answer
See CodeProject example here: Calling All Stations[^]
Share this answer
Member 14594285 23-Feb-23 8:56am    
this example is the opposite...c# that calls c++ libraries, but I need c++ that calls c# libraries..thanks
Now that you've completely reverse the question, and still left out a lot of detail, about the best you're going to get is this: use c# dll in C++ - Google Search[^]

The quality of the answers you get is directly dictated by the quality of the question you ask.
Share this answer
A c# class can expose itself as a COM Server:
C# code [^]

and, If all other methods do not work, you can always use the socket API for interoperability.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900