C++和C#接口对应关系
文章目录
- Windows DATA
- C++和 C#
- 举例说明
-
- 例如我们在C/C++下的结构数据如下:
- 函数转换
- 导入
-
- [Pure]:
- [DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]:
- internal static extern IntPtr UCV_Base_Object_GetName(IntPtr self):
Windows DATA
| Windows DATA Type | .NET Data Type |
|---|---|
| BOOL,BOOLEAN | Boolean or Int32 |
| BSTR | String |
| BYTE | Byte |
| CHAR | Byte |
| DOUBLE | Byte |
| DWPRD | Byte |
| FLOAT | Byte |
| HANDLE(and all other handle types,such as HFONT and HMENU) | IntPtr,UintPtr or HandleRef |
| HRESULT | Int32 or UInt32 |
| INT | Int32 |
| LANGID | Int16 or UInt16 |
| LCID | Int32 or UInt32 |
| LONG | Int32 |
| LPARAM | IntPtr,UintPtr or Objec |
