if (VerQueryValue(lpVI, _T("\\"),
(LPVOID *) &lpFFI, (UINT *) &dwBufSize))
{
//We now have the VS_FIXEDFILEINFO in lpFFI
verMajor = HIWORD(lpFFI->dwFileVersionMS);
}
//Get the Company Name.
//First, to get string information, we need to get
//language information.
VerQueryValue(lpVI, _T("\\VarFileInfo\\Translation"),
(LPVOID*)&langInfo, &cbLang);
//Prepare the label -- default lang is bytes 0 & 1
//of langInfo
wsprintf(tszVerStrName, _T("\\StringFileInfo\\
%04x%04x\\%s"),
langInfo[0], langInfo[1], _T("CompanyName"));
//Get the string from the resource data
if (VerQueryValue(lpVI, tszVerStrName, &lpt, cbBufSize))
companyName.assign((LPTSTR)lpt); //*must* save this