DLL interop / interesting error

char ARRAY[1024]; // <-- global

      


Code below works

myFunctionInDll("some string"); // everything ok

      


Code below doesn't work

myFunctionInDll(ARRAY); // after compilation the entry point of DLL cannot be found

      

So to summarize, if I pass a "static string" to my function inside my dll, the dll compiles and loads fine. However, if I populate a global array (chars) and then try to pass it to my function, it compiles again, but when I try to call the function from my C # application, I get "entry point could not be found". This is really weird and I can't find any reason why ...

Thank you RU.

Does anyone know why?

0


a source to share


1 answer


Are you writing interop, or are you just using an integrated .NET class? If a later attempt

string myStr = "some string";
myFunctionInDll(myStr);

      



Hope it helps.

+1


a source







All Articles