リストコントロールを使用してグリッド関数を作成しました。リストには2つの列があります。データと名前。
ユーザーはファイルを選択する必要があります。ファイル内のデータは最初の列「DATA」に表示され、ファイル名は2番目の列「NAME」に表示されます。コードを書きましたが、リストに何も表示されません
CFileFind finder;
bool bFound;
CString filename = "C:\\ Location\\*.txt";
bFound = finder.FindFile(filename);
if(bFound)
{
while(bFound)
{
bFound = finder.FindNextFile();
if(bFound)
{
m_List.AddString(finder.GetFileName()); //This is where the actual data is added
}
}
CStdioFile files;
CFileException exp;
CString strLine;
if (files.Open(filename, CFile::modeRead, &exp))
{
while(files.ReadString(strLine)){}
}
}
void CuserspecificationDlg::InsertItems()
{
HWND hWnd = ::GetDlgItem(m_hWnd, IDC_LIST1);
// Set the LVCOLUMN structure with the required
// column information
..
..
SetCell(hWnd,out,1,1); // where out is the Cstring variable for edit control
}
何が間違いでしょうか?