VC 6++: CString and GetLength () behaviour
void CDOSDlg::OnDblclkList1()
{
// TODO: Add your control notification handler code here
CString str, str2;
int n;
for (int i=0;i < m_List.GetCount();i++)
{
if (m_List.GetSel( i ) > 0)
break;
}
n = m_List.GetTextLen( i );
m_List.GetText( i, str.GetBuffer(n) );
i = str.GetLength();
str2 = str.Right (i - 25);
AfxMessageBox (str2);
}
All is running well, I can get the expected string, i.e. str. But str.GetLength returns 0 (seen in the watch debug window) instead of the expected value.
Also, all CString functions like MID, LEFT, do not work. I suspect its because of the format of the CString. How could I resolve this?

