求助!获取编辑框字符串
求助!获取编辑框里输入的字符串void CDDlg::OnChangeEdit1()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
char str【】;
GetDlgItem(IDC_EDIT1)->GetwindowText(str);
}
用mfc wizard建立了一个对话框,需要读入编辑框里输入的字符串并进行处理,红色部分报错
error C2039: 'GetwindowText' : is not a member of 'CWnd'
求指教啊!
msdn里对GetwindowText的解释
GetWindowText
The GetWindowText function copies the text of the specified window's title bar (if it has one) into a buffer. If the specified window is a control, the text of the control is copied. However, GetWindowText cannot retrieve the text of a control in another application.
int GetWindowText(
HWND hWnd, // handle to window or control
LPTSTR lpString, // text buffer
int nMaxCount // maximum number of characters to copy
);
Parameters
hWnd
[in] Handle to the window or control containing the text.
lpString
[out] Pointer to the buffer that will receive the text.
nMaxCount
[in] Specifies the maximum number of characters to copy to the buffer, including the NULL character. If the text exceeds this limit, it is truncated.
怎么改呢?不会是我的vc6.0头文件有问题吧。。。
http://zhidao.baidu.com/question/203131774.html
百度有个解释,类似的,为什么改成他说的那样就行了?我的这个怎样改???