又要用C#调用C++写好的api函数,为了方便,将网上的数据类型做个整理,方便以后查找,以后遇到需要的在进行查找

C++ C#    
       
WORD ushort    
DWORD uint    
UCHAR int/byte(大多数情况下都可以使用int代替,而如果需要严格对齐使用byte)
UCHAR* string/IntPtr    
unsigned char * [MarshalAs(UnmanagedType.LPArray)]byte[]/?(Intptr)  
char* string    
LPCTSTR string    
LPTSTR [MarshalAs(UnmanagedType.LPTStr)] string    
long int    
ulong uint    
Handle IntPtr    
HWND IntPtr    
void *  IntPtr    
int  int    
int* ref int     
*int IntPtr    
unsigned int uint    
COLORREF uint    

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-07-13
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-06
  • 2021-06-20
相关资源
相似解决方案