Questa tabella riassuntiva penso sarà utile a chiunque stia "impazzendo" col P/Invoke, (e dire che l'intervento di Raffaele al
workshop è stato pure molto istruttivo...
| C/C++ |
C# |
HANDLE, LPDWORD, LPVOID, void* |
IntPtr |
LPCTSTR, LPCTSTR, LPSTR, char*, const char*, Wchar_t*, LPWSTR |
String [in], StringBuilder [in, out] |
DWORD, unsigned long, Ulong |
UInt32, [MarshalAs(UnmanagedType.U4)] |
bool |
bool |
LP<struct> |
[In] ref <struct> |
SIZE_T |
uint |
LPDWORD |
out uint |
LPTSTR |
[Out] StringBuilder |
PULARGE_INTEGER |
out ulong |
WORD |
uInt16 |
Byte, unsigned char |
byte |
Short |
Int16 |
Long, int |
Int32 |
float |
single |
double |
double |
NULL pointer |
IntPtr.Zero |
Uint |
Uint32 |
L'articolo completo lo trovate
qui
P.S: Postare senza IMHO (che non so perchè oggi non vuole andare... aspetto di riavviare il PC e riprovare prima di dichiararlo un bug!) è un incubo...