I am trying to add items from alistbox to cstringarray. But text is null always. plz suggest the changes
int count = m_OutList.GetCount();
for ( i = 0; i <m_OutList.GetCount(); i++)
{
m_OutList.GetText( buf[i], text );
m_selcomponents->Add(text);
// getb //Add();
}
If
textis a CString in your example, you need to writem_OutList.GetText(i,text)– you don’t need a buffer variable if you pass a CString&.buf[i]is a part of your buffer and has a random value.