平台叫用資料類型

來源:互聯網
上載者:User
下表列出了在 Win32 API(在 Wtypes.h 中列出)和 C 樣式函數中使用的資料類型。許多非託管庫包含將這些資料類型作為參數傳遞並傳回值的函數。第三列列出了在Managed 程式碼中使用的相應的 .NET Framework 內建實值型別或類。某些情況下,您可以用大小相同的類型替換此表中列出的類型。

Wtypes.h 中的非託管類型  非託管 C 語言類型  託管類名  說明  
HANDLE 
 void* 
 System.IntPtr 
 在 32 位 Windows 作業系統上為 32 位,在 64 位 Windows 作業系統上為 64 位。
 
BYTE 
 unsigned char 
 System.Byte 
 8 位
 
SHORT 
 short 
 System.Int16 
 16 位
 
WORD 
 unsigned short 
 System.UInt16 
 16 位
 
INT 
 int 
 System.Int32 
 32 位
 
UINT 
 unsigned int 
 System.UInt32 
 32 位
 
LONG 
 long 
 System.Int32 
 32 位
 
BOOL 
 long 
 System.Int32 
 32 位
 
DWORD 
 unsigned long 
 System.UInt32 
 32 位
 
ULONG 
 unsigned long 
 System.UInt32 
 32 位
 
CHAR 
 char 
 System.Char 
 用 ANSI 修飾。
 
LPSTR 
 char* 
 System.String 或 System.Text.StringBuilder
 用 ANSI 修飾。
 
LPCSTR 
 Const char* 
 System.String 或 System.Text.StringBuilder
 用 ANSI 修飾。
 
LPWSTR 
 wchar_t* 
 System.String 或 System.Text.StringBuilder
 用 Unicode 修飾。
 
LPCWSTR 
 Const wchar_t* 
 System.String 或 System.Text.StringBuilder
 用 Unicode 修飾。
 
FLOAT 
 Float 
 System.Single 
 32 位
 
DOUBLE 
 Double 
 System.Double 
 64 位
 

有關 Visual Basic 2005、C# 和 C++ 中的相應類型,請參見 .NET Framework 類庫介紹。
long * --> ref int
const char * --> string 或 stringBuilder
double * --> ref double
unsigned short * --> ref System.Uint16

const char * * --> string[,]

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.