类型对照表:
Win32 Types
|
CLR Type
|
char, INT8, SBYTE, CHAR
|
System.SByte
|
short, short int, INT16, SHORT
|
System.Int16
|
int, long, long int, INT32, LONG32, BOOL , INT
|
System.Int32
|
__int64, INT64, LONGLONG
|
System.Int64
|
unsigned char, UINT8, UCHAR , BYTE
|
System.Byte
|
unsigned short, UINT16, USHORT, WORD, ATOM, WCHAR , __wchar_t
|
System.UInt16
|
unsigned, unsigned int, UINT32, ULONG32, DWORD32, ULONG, DWORD, UINT
|
System.UInt32
|
unsigned __int64, UINT64, DWORDLONG, ULONGLONG
|
System.UInt64
|
float, FLOAT
|
System.Single
|
double, long double, DOUBLE
|
System.Double
|
c++:HANDLE(void *) ---- c#:System.IntPtr
c++:WORD(unsigned short) ---- c#:System.UInt16
c++:DWORD(unsigned long) ---- c#:System.UInt32
c++:结构体 ---- c#:public struct 结构体{};
c++:结构体 &变量名 ---- c#:ref 结构体 变量名
c++:结构体 **变量名 ---- c#:out
c++:GUID ---- c#:Guid
c++:UINT8 * ---- c#:ref byte
c++:char*/void*(指向一个字符串) ---- c#:string
对于结构体中的指针数组,对应于C#中的IntPtr[]类型,如:
int * a[] -------------- IntPtr[]a
了解更多