So I have a function, written in C++, that looks like this...
extern \"C\" __declspec(dllexport) int __stdcall SomeFunction(char *theData)
{
// stuff
}
Now I know that VB.NET and C# are quite different, but I suppose I always assumed that strings were strings
Strings are immutable in .net. Ask yourself why it is that ByVal
passing of an immutable data type can result in the value changing. That doesn't happen for normal functions, just for Declare
.
I'd guess it all has to do with maintaining some backwards compatibility with Declare
statements from classic VB6 which were done this way. To my mind the black sheep here is the VB.net code rather than the C# code.