我在用VC6.0编程时发现了一个问题,举例子来说:
对于GetDlgItemInt这个API函数来说,有四个参数
UINT GetDlgItemInt(
HWND hDlg, // handle to dialog box
int nIDDlgItem, // control identifier
BOOL *lpTranslated, // points to variable to receive success/failure indicator
BOOL bSigned // specifies whether value is signed or unsigned
);
而有时编程,只用GetDlgItemInt(IDC_EDIT1)即可。
这是怎么回事呢?而有时用GetDlgItemInt(IDC_EDIT1)却不行。
到底该何时用何种呢?
对于GetDlgItemInt这个API函数来说,有四个参数
UINT GetDlgItemInt(
HWND hDlg, // handle to dialog box
int nIDDlgItem, // control identifier
BOOL *lpTranslated, // points to variable to receive success/failure indicator
BOOL bSigned // specifies whether value is signed or unsigned
);
而有时编程,只用GetDlgItemInt(IDC_EDIT1)即可。
这是怎么回事呢?而有时用GetDlgItemInt(IDC_EDIT1)却不行。
到底该何时用何种呢?
CWnd::GetDlgItemInt
UINT GetDlgItemInt( int nID, BOOL* lpTrans = NULL, BOOL bSigned = TRUE ) const;
在CWindow的子类中也是
CWindow::GetDlgItemInt
UINT GetDlgItemInt( int nID, BOOL* lpTrans = NULL, BOOL bSigned = TRUE ) const;
::表示API函数,需要把形参带齐;不带::表示MFC库函数,只要带上控件ID就行了。