So I have a function, written in C++, that looks like this...
extern \"C\" __declspec(dllexport) int __stdcall SomeFunction(char *theData)
{
// stuff
}
Because they are different languages. VB.NET can a great deal of things that C# cannot for many reasons. I don't see the problem to be honest.
I should add you could have simply did ref char[] and it would have worked. One problem I see is that your calling conventions do not match.
So that also is likely the reason you got a memory exception error.