CWindow::GetWindowText int GetWindowText( LPTSTR lpszStringBuf, int nMaxCount ) const;BOOL GetWindowText( BSTR& bstrText );SeeGetWindowText in the Win32 SDK.ResRetrieves the window's text. The second version of this method allows you to store the text in a BSTR. If the text is successfully copied, the return value is TRUE; otherwise, the return value is FALSE.CWindow Overview | Class MembersSee Also CWindow::GetWindowTextLength, CWindow::SetWindowText
int GetWindowText( LPTSTR lpszStringBuf, int nMaxCount ) const;BOOL GetWindowText( BSTR& bstrText );SeeGetWindowText in the Win32 SDK.ResRetrieves the window's text. The second version of this method allows you to store the text in a BSTR. If the text is successfully copied, the return value is TRUE; otherwise, the return value is FALSE.CWindow Overview | Class MembersSee Also CWindow::GetWindowTextLength, CWindow::SetWindowText
char* str2 = _T("");
CWindow editSmtp(GetDlgItem(IDC_S1));
CWindow editUser(GetDlgItem(IDC_S2));
//combo.SendMessage(CB_ADDSTRING, 0, (LPARAM)"Red");
//combo.SendMessage(CB_ADDSTRING, 0, (LPARAM)"Green");
//combo.SendMessage(CB_ADDSTRING, 0, (LPARAM)"Blue");
editSmtp.GetWindowText(str1,128);
editUser.GetWindowText(str2,128);
怎么取出来的字串为空呢??
谢谢!!
char* str2 = _T("");
//字符指针,没有分配空间,两种做法
1、
char str1[128];
char str2[128];
editSmtp.GetWindowText(str1,128);
editUser.GetWindowText(str2,128);
2、
CString str1,str2;
editSmtp.GetWindowText(str1);
editUser.GetWindowText(str2);
那是吹牛。
不过4、5种方法是有的。你自己trytry
GetWindowText(hWndEdit,buf,len....GetDlgItemText(hWndDlg,IDC_EDIT,buf,len...SendMessage(hWndEdit,WM_GETTEXT,....
全踹了!!
也谢谢luckyegg(幸运蛋) prog_st(st) fiolin(幽深的水)(尽管有些胡诹之嫌,你还不如让我那笔记一记来得快些) 和111222(http://newise.net)
如果已没有如果,那怎么办?
可以交个朋友的,prog_st很厉害的!
[email protected]
那个prog_st是谁,看架势很不一般呢,希望也能和他交个朋友。
多谢!
哎,两天上不了网了,真是很郁闷的说
不会else掉的,放心好了
所以今天才见到你的帖子
prog_st也只是在这认识的,不要他说现在很忙的!