void MakeString(unsigned char *dest, char type, float fval,
		float sval, float tval, int div)
{
    *dest = type;
    BuildNumber((dest+1), fval, 3);
    BuildNumber((dest+4), sval, 3);
    BuildNumber((dest+7), tval, 3);
}
void MakeLongString(unsigned char *dest, char type, float val1,
		    float val2, float val3, float val4, float val5, int div)
{
    *dest = type;
    BuildNumber((dest+1), val1, div);
    BuildNumber((dest+4), val2, div);
    BuildNumber((dest+7), val3, div);
    BuildNumber((dest+10), val4, div);
    BuildNumber((dest+13), val5, div);
    return;
}
示例#3
0
CString CWindowsVersion::GetVersionString() const
{
    CString buildNum;
    buildNum.FormatMessage(IDS_BUILD_NUMBER_n, BuildNumber());
    CString str;

    switch(m_osv.dwPlatformId)
    {
    case VER_PLATFORM_WIN32s: //Win32s on Windows 3.1. 
        str = _T("Microsoft® Windows 3.1(TM)");
        break;

    case VER_PLATFORM_WIN32_WINDOWS: //WIN32 on 95 or 98				 
        //determine if Win95 or Win98
        if(m_osv.dwMinorVersion == 0)
        {
            str = _T("Microsoft® Windows 95(TM), ") 
                + buildNum;
            if(lstrlen(m_osv.szCSDVersion))
                str += _T(", ") + CString(m_osv.szCSDVersion);
        }
        else if(m_osv.dwMinorVersion == 10)
        {
            str = _T("Microsoft® Windows 98(TM), ") 
                + buildNum;
            if(lstrlen(m_osv.szCSDVersion))
                str += _T(", ") + CString(m_osv.szCSDVersion);
        }
        else if(m_osv.dwMinorVersion == 90)
        {
            str = _T("Microsoft® Windows Millenium(TM), ") 
                + buildNum;
            if(lstrlen(m_osv.szCSDVersion))
                str += _T(", ") + CString(m_osv.szCSDVersion);
        }
        else
        {
            str.Format(_T("Microsoft® Windows %d.%d"), 
                m_osv.dwMajorVersion, m_osv.dwMinorVersion);
        }
        break;

    case VER_PLATFORM_WIN32_NT: //Win32 on Windows NT. 

        if(m_osv.dwMajorVersion == 4) 
        {
            str = _T("Microsoft® Windows NT(TM), ")  
                + buildNum;
            if(lstrlen(m_osv.szCSDVersion))
                str += _T(", ") + CString(m_osv.szCSDVersion);
        }
        else if(m_osv.dwMajorVersion == 5)
        {
			switch(m_osv.dwMinorVersion)
			{
			case 0:
	            str = _T("Microsoft® Windows 2000(TM), ") + buildNum;
				break;
			case 1:
	            str = _T("Microsoft® Windows XP(TM), ") + buildNum;
				break;
			default:
	            str.Format(_T("Microsoft® Windows %d.%d"), 
					m_osv.dwMajorVersion, m_osv.dwMinorVersion);
				break;
			}
            if(lstrlen(m_osv.szCSDVersion))
                str += _T(", ") + CString(m_osv.szCSDVersion);
        }
        else
        {
            str.Format(_T("Microsoft® Windows %d.%d"), 
                m_osv.dwMajorVersion, m_osv.dwMinorVersion);
        }
        break;

    default: 
        break;
    }
    return str;
}//end if