Hello:
I would like to add the date my EXE file was built (i.e. created) to the
About box.
I thought I had it solved with the code snippet at the end of this e-mail,
but I just found out today that it does not work on Windows 98. Namely, the
call to FindFile() returns FALSE;
Any ideas.
TIA.
Michael
CString CMyApp::GetExecutableDateStamp(strWorkingDir)
{
CString strError = "";
CString strFile = "";
CString strMsg;
FileFind fileFind;
strFile.Format("%s\\AB2000.exe", strWorkingDir);
if(!fileFind.FindFile(strFile))
{
strFile.Format("%s\\Release\\MyApp.exe", m_strWorkingDir);
if(!fileFind.FindFile(strFile))
{
strMsg.Format("%s\n\n%s\n\n%s", "Problem getting the date-stamp
for MyApp.",
"Unable to access the file at:", strFile);
AfxMessageBox(strMsg);
return strError;
}
}
CFile appFile(strFile, 0);
CFileStatus status;
VERIFY(appFile.GetStatus(status));
CString strDateStamp;
strDateStamp.Format("%d-%d-%d %02d:%02d",
status.m_mtime.GetMonth(),
status.m_mtime.GetDay(),
status.m_mtime.GetYear(),
status.m_mtime.GetHour(),
status.m_mtime.GetMinute());
return strDateStamp;
}