Marshaling de données à l’aide de l’appel de plate-forme
CallingConvention
Exemples d’appel de plate-forme
Types de données d’appel de plate-forme
MsgBox, exemple
Spécification d’un jeu de caractères
Strings, exemple
Champ DllImportAttribute.BestFitMapping
Tableau de correspondance entre les types du C++ et du C#
Type non managé dans Wtypes.h | Type langage C non managé | Nom de classe managée | Description |
HANDLE | void* | System.IntPtr | 32 bits |
BYTE | unsigned char | System.Byte | 8 bits |
SHORT | short | System.Int16 | 16 bits |
WORD | unsigned short | System.UInt16 | 16 bits |
INT | int | System.Int32 | 32 bits |
UINT | unsigned int | System.UInt32 | 32 bits |
LONG | long | System.Int32 | 32 bits |
BOOL | long | System.Int32 | 32 bits |
DWORD | unsigned long | System.UInt32 | 32 bits |
ULONG | unsigned long | System.UInt32 | 32 bits |
CHAR |
char | System.Char | Décorer avec ANSI. |
LPSTR | char* | System.String ou System.StringBuilder | Décorer avec ANSI. |
LPCSTR | Const char* | System.String ou System.StringBuilder | Décorer avec ANSI. |
LPWSTR | wchar_t* | System.String ou System.StringBuilder | Décorer avec Unicode. |
LPCWSTR | Const wchar_t* | System.String ou System.StringBuilder | Décorer avec Unicode. |
FLOAT Float | System.Single | 32 bits | |
DOUBLE | Double | System.Double | 64 bits |