The following table lists common prefixes.
| Prefix | Description |
| a | Array |
| b | BOOL (int) |
| c | Char |
| cb | Count of bytes |
| cr | Color reference value |
| cx | Count of x (short) |
| dw | DWORD (unsigned long) |
| f | Flags (usually multiple bit values) |
| fn | Function |
| g_ | Global |
| h | Handle |
| i | Integer |
| l | Long |
| lp | Long pointer |
| m_ | Data member of a class |
| n | Short int |
| p | Pointer |
| s | String |
| sz | Zero terminated String |
| tm | Text metric |
| u | Unsigned int |
| ul | Unsigned long (ULONG) |
| w | WORD (unsigned short) |
| x,y | x , y coordinates (short) |
These are often combined, as in the following.
| Prefix combination | Description |
| pszMyString | A pointer to a string. |
| m_pszMyString | A pointer to a string that is a data member of a class. |
Other conventions are listed in the following table.
| Convention | Description |
| CMyClass | Prefix 'C' for C++ class names. |
| COMyObjectClass | Prefix 'CO' for COM object class names. |
| CFMyClassFactory | Prefix 'CF' for COM class factory names. |
| IMyInterface | Prefix 'I' for COM interface class names. |
| CImpIMyInterface | Prefix 'CImpI' for COM interface implementation classes. |
No comments:
Post a Comment