LarryM
July 1st, 2003, 02:43 PM
Help!
My simple C++ dialog application runs, but I cannot seem to get 'GetSel' to return a valid 'nStartChar' when I click in the middle of a 10-character string in the edit box known as IDC_EDIT1.
void CEditDlg::OnEnSetfocusEdit1()
{ CEdit* pmyEdit = (CEdit*)GetDlgItem(IDC_EDIT1);
int nStartChar, nEndChar;
nStartChar = 1024;
pmyEdit->GetSel(nStartChar, nEndChar);
exit(nStartChar);
}
I expect a 5 but get a 0.
Does anyone know what I'm doing wrong? Thanks.
Larry
My simple C++ dialog application runs, but I cannot seem to get 'GetSel' to return a valid 'nStartChar' when I click in the middle of a 10-character string in the edit box known as IDC_EDIT1.
void CEditDlg::OnEnSetfocusEdit1()
{ CEdit* pmyEdit = (CEdit*)GetDlgItem(IDC_EDIT1);
int nStartChar, nEndChar;
nStartChar = 1024;
pmyEdit->GetSel(nStartChar, nEndChar);
exit(nStartChar);
}
I expect a 5 but get a 0.
Does anyone know what I'm doing wrong? Thanks.
Larry