Calling C# function from C++/CLI - Convert Return C# string to C String
问题 I have a C# function that I made into a DLL: public static string Test(string name) { return "Hello " + name; } In C++/CLI project I successfully import that DLL, now I want to have a way to call that function and make it available for normal unmanaged C++. So I want to export the C++/CLI function like this: extern "C" __declspec(dllexport) void __stdcall Example(char* name, char* greet) { // name will be passed to C# Test(...) function // and greet will contains the returned value // call to