The following table lists the data types that are used in the Win32 API (listed in Wtypes.h) and in the C-style functions. Many unmanaged libraries contain functions that pass these data types as parameters and return values. The third column lists the corresponding. NET Framework built-in value types or classes that are used in managed code. In some cases, you can replace the types listed in this table with the same size type.
Unmanaged C language Type managed class name description for unmanaged classes in Wtypes.h
| Handle |
void* |
System.IntPtr |
32-bit |
| Byte |
unsigned char |
System.Byte |
8-bit |
| Short |
Short |
System.Int16 |
16-bit |
| Word |
unsigned short |
System.UInt16 |
16-bit |
| Int |
Int |
System.Int32 |
32-bit |
| UInt |
unsigned int |
System.UInt32 |
32-bit |
| Long |
Long |
System.Int32 |
32-bit |
| bool |
Long |
System.Int32 |
32-bit |
| DWord |
unsigned long |
System.UInt32 |
32-bit |
| ULong |
unsigned long |
System.UInt32 |
32-bit |
| Char |
Char |
System.Char |
Decorated with ANSI. |
| LPStr |
char* |
System.String or System.stringbuilder |
Decorated with ANSI. |
| Lpcstr |
Const char* |
System.String or System.stringbuilder |
Decorated with ANSI. |
| LPWStr |
wchar_t* |
System.String or System.stringbuilder |
Decorated with Unicode. |
| Lpcwstr |
Const wchar_t* |
System.String or System.stringbuilder |
Decorated with Unicode. |
| Float |
Float |
System.Single |
32-bit |
| Double |
Double |
System.Double |
64-bit |