CString csFilePathName;
::ExpandEnvironmentStrings(_T("%ProgramData%"), csFilePathName.GetBuffer(MAX_PATH), MAX_PATH);
csFilePathName.ReleaseBuffer();
csFilePathName += _T("Test.txt");
if (PathFileExists(csFilePathName))
{
//Other operation
}
CString csFilePathName;
::ExpandEnvironmentStrings(_T("%ProgramData%"), csFilePathName.GetBuffer(MAX_PATH), MAX_PATH);
csFilePathName.ReleaseBuffer();
csFilePathName += _T("Test.txt");
if (PathFileExists(csFilePathName))
{
//Other operation
}