I am attempting to post text to an edit box:
I created a class off of the main dialog window and was using the constructor to initialize the edit box with text:
Constructor:
I was under the impression I could call SetWindowTextW function of CWnd that would allow me to post the string. However, I am receiving the error:
Question 2:
If you needed to get the handle of a window, and you didn't know what it was, what is the correct method?
Thanks in advance.
I created a class off of the main dialog window and was using the constructor to initialize the edit box with text:
Code:
public:
CSnipitDlg(CWnd* pParent = NULL); // standard constructor
Constructor:
Code:
CSnipitDlg::CSnipitDlg(CWnd* pParent /*=NULL*/)
: CDialog(CSnipitDlg::IDD, pParent)
{
CDialog::OnInitDialog();
CWnd *Display;
Display = GetDlgItem(IDC_APPNAME);
Display->SetWindowTextW("Application Name");
return;
}
I was under the impression I could call SetWindowTextW function of CWnd that would allow me to post the string. However, I am receiving the error:
Code:
"error C2664: 'CWnd::SetWindowTextW' : cannot convert parameter 1 from 'const char [17]' to 'LPCTSTR'
Question 2:
If you needed to get the handle of a window, and you didn't know what it was, what is the correct method?
Thanks in advance.