I have a dot net core application and I have to get the response from the C++ application. Also send the response back to C++ also.
In simple terms,
C++ -> C#
C# -> C++
I have gone through many links and got to know we can use DllImport in the C# application to access the Cpp methods. But DllImport and Named Pipeline are both the same or different?
If it is different, I want to access the C++ methods in the CSharp application using the Named pipeline.
Please suggest any links and clarify my doubts.
Thanks!
DllImportand named pipelines are completely different things. You could indeed useDllImportand declarestatic externfunctions that match the signature of your (exported) C++ functions and call them from your C# application. See: https://learn.microsoft.com/en-us/dotnet/standard/native-interop/pinvokeNamed pipelines are for sending data from one application (or module) to another, where you would have to do the serialization and deserialization and/or mapping to functions yourself.
If you just want to call C++ code from C# code,
DllImportis the way to go.