// Definitions for Version from Version Resource class
// Written by Frank Solomon 2000
//
#include "ver.h"
namespace fss {
VersionResource::VersionResource() {
HRSRC hrV = FindResource(NULL,"#1",RT_VERSION);
if(hrV == NULL) {
throw;
} else {
HGLOBAL hgrV = LoadResource(NULL,hrV);
if(hgrV == NULL) {
throw;
} else {
LPVOID pV = LockResource(hgrV);
if(VerQueryValue(pV,"\\StringFileInfo\\040904b0\\FileVersion",&VBuf,&VLen)) {
if(VLen > 0 && VLen < 1024) {
wsprintf(VString,"%s",VBuf);
} else {
throw;
}
}
FreeResource(hgrV);
}
}
}
const char *VersionResource::c_str() const {
return (const char *)VString;
}
}