bool GetVerComCtl32() { CModuleVersion ver; DLLVERSIONINFO dvi; VERIFY(ver.DllGetVersion(_T("comctl32.dll"), dvi)); int iVerComCtl32 = dvi.dwMajorVersion*100 + dvi.dwMinorVersion; if (iVerComCtl32 < 471) { CString str; str.Format(_T("Copyright (c) 1998-99 Kirk Stowell\nmailto:[email protected] - http://www.codejockeys.com/kstowell/\n\nCode Jockey's CJ60 extension library requires ComCtl32.dll, version 4.71 or later. The curent version found on this system is %d.%d.%d. To get the latest version of ComCtl32.dll visit Microsoft's site at:\n\nhttp://www.microsoft.com/msdn/downloads/files/40comupd.htm"), dvi.dwMajorVersion, dvi.dwMinorVersion, dvi.dwBuildNumber); AfxMessageBox(str, MB_ICONSTOP); return false; } return true; }
DWORD _AfxGetComCtlVersion() { // return cached version if already determined... if (_afxComCtlVersion != -1) return _afxComCtlVersion; CModuleVersion ver; ver.GetModuleVersionInfo (_T("COMCTL32.DLL")); DLLVERSIONINFO dvi; DWORD dwVersion = VERSION_WIN4; if (ver.DllGetVersion (_T("COMCTL32.DLL"), dvi)) { dwVersion = MAKELONG(dvi.dwMinorVersion, dvi.dwMajorVersion); } _afxComCtlVersion = dwVersion; return dwVersion; }