我在成员函数中有这样一句,
SetDlgItemText(IDC_EDIT2,s);
IDC_EDIT2是一个Edit Control的ID,s是一个char型的数组,但是编译的时候老是提示我下面的错误,不知道为什么?请各位高人指点啊。错误如下:
error C2660: 'SetDlgItemTextA' : function does not take 2 arguments
...全文
7666打赏收藏
MFC编程SetDlgItemText的问题
我在成员函数中有这样一句, SetDlgItemText(IDC_EDIT2,s); IDC_EDIT2是一个Edit Control的ID,s是一个char型的数组,但是编译的时候老是提示我下面的错误,不知道为什么?请各位高人指点啊。错误如下: error C2660: 'SetDlgItemTextA' : function does not take 2 arguments
::SetDlgItemText
The SetDlgItemText function sets the title or text of a control in a dialog box.
BOOL SetDlgItemText(
HWND hDlg, // handle of dialog box
int nIDDlgItem, // identifier of control
LPCTSTR lpString // text to set
);
Parameters
hDlg
Identifies the dialog box that contains the control.
nIDDlgItem
Identifies the control with a title or text that is to be set.
lpString
Pointer to the null-terminated string that contains the text to be copied to the control.
Return Values
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
The SetDlgItemText function sends a WM_SETTEXT message to the specified control.
---------------
CWindow::SetDlgItemText
BOOL SetDlgItemText( int nID, LPCTSTR lpszString );
SeeSetDlgItemText in the Win32 SDK.
Remarks
Changes a control’s text.
---------------
CWnd::SetDlgItemText
void SetDlgItemText( int nID, LPCTSTR lpszString );
Parameters
nID
Identifies the control whose text is to be set.
lpszString
Points to a CString object or null-terminated string that contains the text to be copied to the control.
Remarks
Sets the caption or text of a control owned by a window or dialog box.
SetDlgItemText sends aWM_SETTEXT message to the given control.
error C2660: 'SetDlgItemTextA' : function does not take 2 arguments
不接受两个参数
函数原型
BOOL WINAPI SetDlgItemText(
_In_ HWND hDlg,
_In_ int nIDDlgItem,
_In_ LPCTSTR lpString
);