An existing application is going to import my class library. I am trying to do this in C# since I have a lot more experience in C# than C++. The existing application uses __stdcall which is originally not possible with C# since the code is managed. I use a library called RGiesecke.DllExport to do unmanaged exports.
[DllExport("LibraryOpen", CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall)]
static int LibraryOpen(int* session, char* description)
{
//I need to fill description here.
}
I have an example header of the function in C/C++
typedef int (__stdcall *LibraryOpen)(int *session, WCHAR *description);
The purpose of this function is, that I fill the description pointer with a short description of my library.
The problem is that I am not sure if char* is a good use here, and I don't know how to fill this pointer with a string.
I hope someone can help me with this, thank you very much in advance.