Tested By:
Error from: The following program, under the VS2010 use getfilename (), the file can be read successfully, but under VS2013, use getfilename () read the file under Debug can, However, after the release fails, instead of getpathname (), it can be compiled successfully.
CFileDialog Filepclouddlg (TRUE);
filepclouddlg.m_ofn.lpstrtitle=_t ("Select Point Cloud File");
filepclouddlg.m_ofn.lpstrfilter=_t ("Text files (*.txt) \0*.txt\0all files (*. *) \0*.*\0\0");
if (Idok==filepclouddlg.domodal ())
{
Icp.msVecSrcPoints.clear (); Emptying the point cloud storage container
//cstring filename = filepclouddlg.getfilename ();//Gets the file name selected by the user
CString fileName = Filepclouddlg.getpathname ();//Get the full path name of the file
Std::ifstream Filepcloud (fileName);
if (!filepcloud)
{
MessageBox (_t ("Unable to open the file!");
}
while (!filepcloud.eof ())
{
filepcloud>>pointcloud;
if (filepcloud.eof ())
{
Break
}
Icp.msVecSrcPoints.push_back (Pointcloud);
}
Filepcloud.close ();
}
About VS2013 after the optimization of the MFC file read failure parsing (debug can, release under the failure)