I am a beginner to Visual Studio C++. I am creating a dialog based application using MFC. I want to read some file and display some required text from that file in the dialog.
the code is:
CFileFind finder;
bool bFound;
CString filename = "C:\\FilesLocation\\*.txt";
bFound = finder.FindFile(filename);
if(bFound)
{
m_List.AddString(finder.GetFileName()); }
in the last line, error appears, whereas m_List is the member variable for List Control/
and Clistctrl has no member Addstring.
How to access the file name and display in the dialog ??
Depending on what exactly you’re going to achieve, use CListCtrl::InsertItem
or use
CListBoxinstead ofCListCtrl.CListBoxhasAddStringmethod.