m_strSpecialBuild = _T("");
m_strPrivateBuild = _T("");
m_bQueryDone=FALSE;
+ memset(&m_FixedFileInfo, 0, sizeof(m_FixedFileInfo));
}
CString CVersionInfo::GetFileVersion()
return m_strProductVersion;
}
+static CString MakeVersionString(DWORD hi, DWORD lo)
+{
+ CString sver;
+ sver.Format(_T("%d.%d.%d.%d"), HIWORD(hi), LOWORD(hi), HIWORD(lo), LOWORD(lo));
+ return sver;
+}
+
+CString CVersionInfo::GetFixedProductVersion()
+{
+ if (!m_bQueryDone)
+ GetVersionInfo();
+ return MakeVersionString(m_FixedFileInfo.dwProductVersionMS
+ , m_FixedFileInfo.dwProductVersionLS);
+}
+
CString CVersionInfo::GetComments()
{
if (!m_bQueryDone)
m_lpstrVffInfo = (LPTSTR)GlobalLock(hMem);
if (GetFileVersionInfo(szFileName, dwVerHnd, dwVerInfoSize, m_lpstrVffInfo))
{
+ GetFixedVersionInfo();
if (m_strLanguage.IsEmpty()
|| m_strCodepage.IsEmpty())
{
s = _T("");
}
+void CVersionInfo::GetFixedVersionInfo()
+{
+ VS_FIXEDFILEINFO * pffi;
+ UINT len = sizeof(*pffi);
+ BOOL bRetCode = VerQueryValue(
+ (LPVOID)m_lpstrVffInfo, _T("\\"), (LPVOID *)&pffi, &len);
+ memcpy(&m_FixedFileInfo, pffi, sizeof(m_FixedFileInfo));
+}
/*******************************************************************************
class CVersionInfo
{
LPTSTR m_lpstrVffInfo;
+ BOOL m_bQueryDone;
+ VS_FIXEDFILEINFO m_FixedFileInfo;
+
CString m_strFileName;
CString m_strLanguage;
CString m_strCodepage;
CString m_strSpecialBuild;
CString m_strPrivateBuild;
void Init();
- BOOL m_bQueryDone;
public:
CVersionInfo(LPCTSTR szFileToVersion = NULL,
CString GetComments();
CString GetSpecialBuild();
CString GetPrivateBuild();
+ CString GetFixedProductVersion();
protected:
void GetVersionInfo();
+ void GetFixedVersionInfo();
void QueryValue(LPCTSTR szId, CString& s);
};
CDialog::OnInitDialog();
CVersionInfo version;
- AfxFormatString1(m_strVersion, IDS_VERSION_FMT, version.GetProductVersion());
+ CString sVersion = version.GetFixedProductVersion();
+ AfxFormatString1(m_strVersion, IDS_VERSION_FMT, sVersion);
m_ctlCompany.SetWindowText(version.GetLegalCopyright());
m_ctlWWW.m_link = _T("http://winmerge.sourceforge.net");
if (ft.CreatePointFont( 100, _T("Arial"), &dc ))
oldfont = dc.SelectObject(&ft);
- AfxFormatString1(s, IDS_VERSION_FMT, version.GetProductVersion());
+ CString sVersion = version.GetFixedProductVersion();
+ AfxFormatString1(s, IDS_VERSION_FMT, sVersion);
dc.SetBkMode(TRANSPARENT);
dc.TextOut(90, 110, s);
if (oldfont != NULL)
2003-03-25 Perry
PATCH: [ 709575 ] Fix sanity check in CChildFrame::UpdateHeaderSizes()
WinMerge: ChildFrm.cpp
+ PATCH: [ 708542 ] Make splash & about show language-independent version
+ common: version.cpp version.h
+ WinMerge: Merge.cpp Splash.cpp
2003-03-25 Christian
Replace COPYING with corrected version from http://www.gnu.org/licenses/gpl.txt