c# c++数据类型对照
来源:互联网 发布:淘宝佣金骗术 编辑:程序博客网 时间:2024/06/06 02:12
最近再做c#调用c++编写的dll。在网上查了查两者的数据对照,自己再重新总结一遍,可能会有重复或者多种方案。如果有错误希望大家给提出,反正我也不改!
c++ c#
HANDLE(void *) ----------------------------------------System.IntPtr
Byte(unsigned char) ----------------------------------System.Byte
SHORT(short) ------------------------------------------System.Int16
WORD(unsigned short) -----------------------------System.UInt16
INT(int) ---------------------------------------------------System.Int16
INT(int) ---------------------------------------------------System.Int32
UINT(unsigned int) -----------------------------------System.UInt16
UINT(unsigned int) -----------------------------------System.UInt32
LONG(long) -------------------------------------------- System.Int32
ULONG(unsigned long) ---------------------------- System.UInt32
DWORD(unsigned long) ----------------------------System.UInt32
DECIMAL ------------------------------------------------ System.Decimal
BOOL(long) ---------------------------------------------System.Boolean
CHAR(char) ---------------------------------------------System.Char
LPSTR(char *) ------------------------------------------System.String
LPWSTR(wchar_t *) -----------------------------------System.String
LPCSTR(const char *) --------------------------------System.String
LPCWSTR(const wchar_t *) -------------------------System.String
PCAHR(char *) -------------------------------------------System.String
BSTR --------------------------------------------------------System.String
FLOAT(float) -----------------------------------------------System.Single
DOUBLE(double) -----------------------------------------System.Double
VARIANT -----------------------------------------------------System.Object
PBYTE(byte *) -----------------------------------------------System.Byte[]
BSTR ----------------------------------------------------------StringBuilder
LPCTSTR ---------------------------------------------------- StringBuilder
LPCTSTR ---------------------------------------------------- string
LPTSTR -------------------------------------------------------[MarshalAs(UnmanagedType.LPTStr)] string
LPTSTR 输出变量名 --------------------------------------StringBuilder 输出变量名
LPCWSTR --------------------------------------------------- IntPtr
BOOL ----------------------------------------------------------bool
HMODULE ---------------------------------------------------IntPtr
HINSTANCE -------------------------------------------------IntPtr
结构体 --------------------------------------------------------public struct 结构体{};
结构体 **变量名 -------------------------------------------out 变量名 //C#中提前申明一个结构体实例化后的变量名
结构体 &变量名 ------------------------------------------- ref 结构体 变量名
WORD --------------------------------------------------------ushort
DWORD ------------------------------------------------------uint
DWORD ------------------------------------------------------int
UCHAR -------------------------------------------------------int
UCHAR -------------------------------------------------------byte
UCHAR* -----------------------------------------------------string
UCHAR* -----------------------------------------------------IntPtr
GUID ----------------------------------------------------------Guid
Handle --------------------------------------------------------IntPtr
HWND --------------------------------------------------------IntPtr
DWORD ------------------------------------------------------int
COLORREF -------------------------------------------------uint
unsigned char ----------------------------------------------byte
unsigned char * --------------------------------------------ref byte
unsigned char * --------------------------------------------[MarshalAs(UnmanagedType.LPArray)] byte[]
unsigned char * --------------------------------------------[MarshalAs(UnmanagedType.LPArray)] Intptr
unsigned char & --------------------------------------------ref byte
unsigned char ----------------------------------------------byte
unsigned short --------- -----------------------------------ushort
unsigned int --------------------------------------------------uint
unsigned long -----------------------------------------------ulong
- c# c++数据类型对照
- C#与.NET数据类型对照
- C# 与 C++ 数据类型对照
- C# 与 C++ 数据类型对照
- C# 与 C++ 数据类型对照
- C++与C#数据类型对照
- C# 与 C++ 数据类型对照
- C# 与 C++ 数据类型对照
- C# 与 C++ 数据类型对照
- C# 与 C++ 数据类型对照
- c++和c#数据类型对照
- c++和c#数据类型对照
- C# 与 C++ 数据类型对照
- C++与C#数据类型对照
- C# 与 C++ 数据类型对照
- C# 与 C++ 数据类型对照
- C# 与 C++ 数据类型对照
- C# 与 C++ 数据类型对照
- user CPU sys CPU
- 美国IT圈家谱
- Bash - the shell (2)
- VIM常用命令总结
- ubuntu 11.10 laucher和全局菜单不见的处理方式
- c# c++数据类型对照
- android 记得用mkdirs不要用mkdir
- 栈的push、pop序列
- 软件需求、架构培训(一)
- java程序设计与问题解决(基础篇)-读书笔记-5
- 软件需求、架构培训(二)功能模型
- 在windows phone 7上获取本地IP的方法
- 适合Linux处理器介绍
- DevExpress 如何打印