I have a C++ dll that contains this method in the header (C++ code):
enum Error
{
Error1,
Error2,
Error3,
}
void foo(const char* str, Error &err) ;
I am trying to call this method using a DllImport attribute but with no success. All other methods on this dll I can call with no problem.
On the DllImport I converted foo method to this:
enum Error
{
Error1,
Error2,
Error3,
}
[DllImport("dll_name.dll")]
public static extern void foo(string str, ref Error err);
but this isn't working either. I've also tried to use 'MarshalAs(UnmanagedType.LPStruct)' on the string and tried to change the 'CharSet' on the dllImport attribute => but nothing works