Hi,
I have an *.lct file. I like to read *.lct file and save an bmp image.
I can not read this file using usual file read.
Find the attachment. change the file extension *.lct instead of *.txt. I like to read ASCII Data into Hex,
Example : Data "A" as "41" (Refer the jpeg image). How is possible?
I have an *.lct file. I like to read *.lct file and save an bmp image.
I can not read this file using usual file read.
Code:
void CLCTtoBMPDlg::OnBnClickedReadlctfile()
{
CFileException CFileEx;
CStdioFile ReadFile;
CString OpenlctfilePath;
TCHAR szFilters[]= _T("LCT Files (*.lct)");
CFileDialog fileDlg(TRUE, _T("bmp"), _T("*.lct"), OFN_FILEMUSTEXIST | OFN_HIDEREADONLY, szFilters);
fileDlg.m_ofn.lpstrTitle = _T("lct Files");
fileDlg.m_pOFN->lpstrInitialDir=_T("D:\\");
if(fileDlg.DoModal() == IDOK)
{
OpenlctfilePath = fileDlg.GetPathName();
MessageBox(OpenImageFilePath);
CFileException CfileEx;
CStdioFile ReadFile;
if(!ReadFile.Open(OpenlctfilePath, CFile::modeNoTruncate | CFile::modeRead, &CfileEx))
{
CFileEx.ReportError();
MessageBox(_T("Setting File Was Not Found"));
return ;
}
TRY
{
CString sLine;
int iLineCount = 0;
while(ReadFile.ReadString(sLine))
{
::AfxMessageBox(sLine);
}
ReadFile.Close();
}
CATCH (CFileException, e)
{
AfxMessageBox(_T("File could not be opened %d"),e->m_cause);
return ;
}
END_CATCH
}
}
Example : Data "A" as "41" (Refer the jpeg image). How is possible?