flavour404
flavour404

Reputation: 6312

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 sum up, if I pass a "static string" to my function inside my dll the dll compiles and loads perfectly. However, if I populate the global array (chars) and then try and pass that to my function, again it compiles but when I try and call the function from my C# app I get 'entry point cannot be found.' This is really strange and I can find no reason why...

Thanks RU.

Anyone know why?

Upvotes: 0

Views: 212

Answers (1)

another average joe
another average joe

Reputation: 668

Did you write the interop or are you just using the .NET generated interop class? If the later try

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

Hope that helps.

Upvotes: 1

Related Questions