分类: C/C++
2011-11-22 20:30:47
MFC命名规则:
Windows类型 | 样本变量 | MFC类 | 样本变量 |
HWND | hWnd; | CWnd* | pWnd; |
HDLG | hDlg; | CDialog* | pDlg; |
HDC | hDC; | CDC* | pDC; |
HGDIOBJ | hGdiObj; | CGdiObject* | pGdiObj; |
HPEN | hPen; | CPen* | pPen; |
HBRUSH | hBrush; | CBrush* | pBrush; |
HFONT | hFont; | CFont* | pFont; |
HBITMAP | hBitmap; | CBitmap* | pBitmap; |
HPALETTE | hPaltte; | CPalette* | pPalette; |
HRGN | hRgn; | CRgn* | pRgn; |
HMENU | hMenu; | CMenu* | pMenu; |
HWND | hCtl; | CState* | pState; |
HWND | hCtl; | CButton* | pButton; |
HWND | hCtl; | CEdit* | pEdit; |
HWND | hCtl; | CListBox* | pListBox; |
HWND | hCtl; | CComboBox* | pComboBox; |
HWND | hCtl; | CScrollBar* | pScrollBar; |
HSZ | hszStr; | CString | pStr; |
POINT | pt; | CPoint | pt; |
SIZE | size; | CSize | size; |
RECT | rect; | CRect | rect; |
vc资源名字定义格式:
单选项控件: IDC_RDB_XX //RDB:RadioButton
前缀 | 类型 |
a | 数组 (Array) |
b | 布尔值 (Boolean) |
by | 字节 (Byte) == 8 bit |
c | 有符号字符 (Char) |
cb | 无符号字符 (Char Byte,没有多少人用) |
cr | 颜色参考值 (ColorRef) |
cx,cy | 坐标差(长度 ShortInt) |
dw | 双字 (Double Word) == 4 Byte == 4 * 8 bit |
fn | 函数(function) |
h | 句柄(Handle) |
i | 整型(int) |
l | 长整型 (Long int) |
lp | 长指针(Long Pointer) |
m_ | 类的成员(member of a class) |
n | 短整型 (Short Int) |
np | 近指针(Near Pointer) |
p | 指针(Pointer) |
s | 字符串型(string) |
sz | 以字符''结尾的字符串 (String with Zero End) |
w | 字(Word) == 2 Byte == 2 * 8 bit |