【C++】判断本地文件是否存在


LVT_RETURN_STATUS CLVTBasicFunction::sp_IsFileExists(CString strPath)
{

	//获取同级目录下的DICOM文件
	CString tempFile=strPath.Left(strPath.ReverseFind('.'));
	tempFile+=".dcm";

	if (PathFileExists(tempFile))
	{
		return IMAGEGRID_NORMAL;
	}
	else
	{
		AfxMessageBox("对应的DICOM文件不存在");
		return IMAGEGRID_ERROR;
	}

}


你可能感兴趣的:(【C++】判断本地文件是否存在)