I would like to ask your guidance of how to call a C++ .dll
from C#
and process/share the result with C#
.
Let's say I have a call e.g processFile
which returns a struct called ResultDetails
. How can I share/use this object in C#
given that I use CMake
and preferrably mingw-gcc
.
(Probably I won't be able to share the object as it is, but is it possible to somehow serialize it to a C#
compatible format and desirialize it in C#.(I would not prefer to serialize the result to JSON
write it to a file and read it from C#.
))
Sample c++ header
ResultDetails* processFile(char *filePath);
struct ResultDetails {
std::vector<std:Exception> exceptions;
Geometry geometry;
std::vector<Surfaces> surfaces;
}
Any idea is appreciated, Thank you for your time and patient