類(lèi)型對(duì)照表:
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++:結(jié)構(gòu)體 ---- c#:public struct 結(jié)構(gòu)體{};
c++:結(jié)構(gòu)體 &變量名 ---- c#:ref 結(jié)構(gòu)體 變量名
c++:結(jié)構(gòu)體 **變量名 ---- c#:out
c++:GUID ---- c#:Guid
c++:UINT8 * ---- c#:ref byte
c++:char*/void*(指向一個(gè)字符串) ---- c#:string
對(duì)于結(jié)構(gòu)體中的指針數(shù)組,對(duì)應(yīng)于C#中的IntPtr[]類(lèi)型,如:
int * a[] -------------- IntPtr[]a
了解更多