To get the full file path of the current application use something like this:
WORD MajorVersion =0;
WORD MinorVersion =0;
WORD BuildNumber =0;
WORD RevisionNumber =0;
TCHAR fileName[4096];
GetModuleFileName(NULL,fileName,4096);
//theApp.m_pszExeName is no good
GetAppVersion(fileName,
&;;MajorVersion,
&;;MinorVersion,
&;;BuildNumber,
&;;RevisionNumber);
m_strVersion.Format (_T("%s, Version:%hu.%hu.%hu.%hu"),theApp.m_pszAppName,MajorVersion,MinorVersion,BuildNumber,RevisionNumber);
CWnd* pWndAppStatic= GetDlgItem (IDC_STATIC_VERSION);
if (pWndAppStatic)
pWndAppStatic->SetWindowText (m_strVersion);
Also, for the GetAppVersion() function to work, you need to add
#pragma comment(lib,"Version.lib")
to the beginning of the .cpp file.
VS2008, MFC feature pack, 32-bit app.IDC_STATIC_VERSION is the ID of one static control in the About Dialog.