I use windows 7 and VS2010 to build a C++ MFC project to perform some test.
In the end of the test, I wrote some code to save the test results into a HTML file. Now I want to add some test result photos in D:// into the HTML file.
Is it possible to do that in C++?
In the end of the test:
WriteReport(m_report_info); //writereport
The definition:
BOOL CControllerDlg::WriteReport(REPORT_INFO reportInfo)
{
if(reportInfo.m_bt_addr.IsEmpty()) return FALSE;
CString strTime = CTime::GetCurrentTime().Format("%Y%m%d%H%M%S");
CStdioFile htmlFile;
CString res = (reportInfo.m_bt_result?"Pass":"Fail");
CString html_name;
......
if(htmlFile.Open(html_name,CFile::modeCreate | CFile::modeReadWrite))
{
CString strHTML = "<html>";
strHTML += "<title>Test Report</title>";
strHTML += "<body>";
strHTML += "<h1 align=center>Test Report</h1>";
strHTML += "</body>";
strHTML += "</html>";
htmlFile.WriteString(strHTML);
htmlFile.Close();
}
else
{
return FALSE;
}
return TRUE;
}
The photo is in D://test//photo1. I want to insert the photo in the body part of the report HTML file. I am using C++, so it's different from front-end method.