Apparently it's important to use Int32 instead of int when messing around with the DLLImport stuff?
2 answers
I think it is more likely that you read about using IntPtr
instead int
. As others have said, int
and are Int32
equivalent.
In fact, no problem exchange int
and IntPtr
a 32-bit system, since they are the same size (4 bytes). The problem arises when on a 64 bit system - if you use int
instead IntPtr
, it is now the wrong size (4 bytes instead of 8 bytes) and may cause errors.
+6
a source to share