I am a new guy with ATL. So forgive me to ask this question.
Problem Description:
One CEdit control is added to the ATL dialog class. It is attached to the dialog initialization function.
ATLControls::CEdit m_txtInput;
m_txtInput.Attach(GetDlgItem(IDC_INPUT_LINE));
m_txtInput.SetWindowText(_T("New directory"));
GetDlgItemText(IDC_INPUT_LINE, input);
ZeroMemory(m_lptstrInput, MAX_PATH);
m_txtInput.GetLine(0, m_lptstrInput, MAX_PATH);
BSTR input;
m_txtInput.GetWindowText(input);
There is a topic on how to get text from CEdit, but it does not work.
Why can a CEdit control be set using the SetWindowText () function, but cannot get text using the GetWindowText () function? It bothers me a lot. Thanks so much if anyone can explain this to me.
source
share