B
Beorne
I have to call a c++ library funtion with the following signature:
void ReadBool(bool* pb1)
[DllImport("library.dll")]
unsafe static extern void NicamPLCRead(out bool);
but this does not work, the bool (not initialized) is not correctly
returned.
But when I write
[DllImport("library.dll")]
unsafe static extern void NicamPLCRead(ref bool);
All goes well.
It is correct that to marshall poiters it is only correct to use "ref"
and not "out"?
Thanks.
void ReadBool(bool* pb1)
From C# I've imported the function as
[DllImport("library.dll")]
unsafe static extern void NicamPLCRead(out bool);
but this does not work, the bool (not initialized) is not correctly
returned.
But when I write
[DllImport("library.dll")]
unsafe static extern void NicamPLCRead(ref bool);
All goes well.
It is correct that to marshall poiters it is only correct to use "ref"
and not "out"?
Thanks.