Home > Software engineering >  In the MFC ListControl SetItemText () function can't display the data
In the MFC ListControl SetItemText () function can't display the data

Time:05-22

Double d=0.65;

M_List. InsertColumn (0, _T (" original image file name "), LVCFMT_CENTER, the rect. The Width ()/2, 0).
M_List. InsertColumn (1, _T (" d value "), LVCFMT_CENTER, the rect. The Width ()/2, 1);
CFileFind finder.
CStringList filelist;//file list
BOOL bResult=finder. FindFile (strPathNametwo);
int i=0;
While (bResult)
{
BResult=finder. The FindNextFile ();
//judge whether directory or hidden files, or the ".. "And". ", if it is, into the next round of cycle
If (finder. IsDirectory () | | finder. IsDots () | | finder. IsHidden ())
continue;
The else//if the file is
{
Cstrings STR.
//get the filename
STR=finder. GetFileName ();
//get the file suffix
Int nLen=STR. GetLength () - finder. GetFileTitle () GetLength ();
STR=STR. Right (nLen);
//determine the file format, if it is the image file, to save the full path in the list
If (STR==". JPG "| | STR==" PNG "| | STR==". BMP "| | STR==". GIF "| | STR==". Tif ") {
Filelist. AddTail (finder. GetFilePath ());
Cstrings filePath=finder. GetFilePath ();
Mat imageInput=imread (filePath. GetBuffer (0));
M_List. InsertItem (index, the finder GetFileName ());//file name
//m_List SetItemText (index, 1, "0");//update//similarity
M_List. SetItemText (index, 1, (LPCTSTR) (& amp; D));

index++;
i++;
//waitKey (500);//pause 0.5 S
}
}
}

Double the value of d is actually I use an algorithm to get the value of the, here I use specific data, in SetItemText () function can't show the d value, seek bosses advice!!!!!!

CodePudding user response:

BOOL SetItemText (int nItem, int nSubItem, LPTSTR lpszText ).
Request the value of the text is not d converting (string)

  • Related