bluewing,
You will have to declare the function as returning IntPtr, and then you
can use the static methods on the Marshal class to read the bytes from
unmanaged memory into a managed array.
The thing is, how will you know how many bytes to marshal? The
signature doesn't have anything on it to indicate the length of the array.
You also have the issue of how to deallocate the memory for the array.
Once you marshal the bytes over, you would have to call some other method,
passing the IntPtr to deallocate the memory block that was allocated upon
return.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard. caspershouse.co m
"bluewing" <kr*****@dreamw iz.com> wrote in message
news:11******** *************@t 31g2000cwb.goog legroups.com...
Oh, I made a mistake...
The unmanaged dll function I have to marshing is not that, but this...
__declspec(dlli mport) BYTE* System_Read(int nSys);
I want to use this function in my dotnet application with C#