读书人

C#调用DLL资料时参数对应表

发布时间: 2012-09-08 10:48:07 作者: rapoo

C#调用DLL文件时参数对应表
Wtypes.h 中的非托管类型非托管 C 语言类型托管类名说明HANDLEvoid*System.IntPtr32 位BYTEunsigned charSystem.Byte8 位SHORTshortSystem.Int1616 位WORDunsigned shortSystem.UInt1616 位INTintSystem.Int3232 位UINTunsigned intSystem.UInt3232 位LONGlongSystem.Int3232 位BOOLlongSystem.Int3232 位DWORDunsigned longSystem.UInt3232 位ULONGunsigned longSystem.UInt3232 位CHARcharSystem.Char用 ANSI 修饰。LPSTRchar*System.String 或 System.StringBuilder用 ANSI 修饰。LPCSTRConst char*System.String 或 System.StringBuilder用 ANSI 修饰。LPWSTRwchar_t*System.String 或 System.StringBuilder用 Unicode 修饰。LPCWSTRConst wchar_t*System.String 或 System.StringBuilder用 Unicode 修饰。FLOATFloatSystem.Single32 位DOUBLEDoubleSystem.Double64 位


类别类名说明Visual Basic 数据类型C# 数据类型C++ 托管扩展数据类型JScript 数据类型整数Byte8 位的无符号整数。BytebytecharByte SByte8 位的有符号整数。

不符合 CLS。

SByte

无内置类型。

sbytesigned charSByte Int1616 位的有符号整数。Shortshortshortshort Int3232 位的有符号整数。Integerintint

- 或 -

long

int Int6464 位的有符号整数。Longlong__int64long UInt1616 位的无符号整数。

不符合 CLS。

UInt16

无内置类型。

ushortunsigned shortUInt16 UInt3232 位的无符号整数。

不符合 CLS。

UInt32

无内置类型。

uintunsigned int

- 或 -

unsigned long

UInt32 UInt6464 位的无符号整数。

不符合 CLS。

UInt64

无内置类型。

ulongunsigned __int64UInt64浮点Single单精度(32 位)浮点数字。Singlefloatfloatfloat Double双精度(64 位)浮点数字。Doubledoubledoubledouble逻辑Boolean布尔值(真或假)。Booleanboolboolbool其他CharUnicode(16 位)字符。Charcharwchar_tchar Decimal96 位十进制值。DecimaldecimalDecimalDecimal IntPtr大小取决于基础平台(32 位平台上为 32 位值,64 位平台上为 64 位值)的有符号整数。IntPtr

无内置类型。

IntPtr

无内置类型。

IntPtr

无内置类型。

IntPtr UIntPtr大小取决于基础平台的无符号整数(32 位平台上为 32 位值,64 位平台上为 64 位值)。

不符合 CLS。

UIntPtr

无内置类型。

UIntPtr

无内置类型。

UIntPtr

无内置类型。

UIntPtr类对象Object对象层次结构的根。ObjectobjectObject*Object StringUnicode 字符的不变的定长串。StringstringString*String

读书人网 >C#

热点推荐