Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Version information

Status
Not open for further replies.

hennep

Programmer
Dec 10, 2000
429
How can I get version information from an application.
I would like to show the version number from the project/options in the caption of an about form.
The example project supplied with cbuilder contains errors.
 
problem solved !!!

void TfrmCTdir::SetCaption(void) {
unsigned long lSize;
unsigned int iLen;
char *pValue, *pBuf, *pKey, *sFile = Application->ExeName.c_str();
lSize = GetFileVersionInfoSize( sFile, &lSize );
if( lSize > 0 ) {
pValue = (char*) malloc(1024);
pKey = (char*) malloc(1024);
pBuf = (char*) malloc(lSize);
GetFileVersionInfo( sFile, 0, lSize, pBuf );
if( VerQueryValue( pBuf, "StringFileInfo\\040904E4\\FileVersion"
, (void**) &pValue, &iLen ) ) {
sprintf( pBuf, "CTdir version %s", pValue );
this->Caption = pBuf;
}
free( pValue );
free( pKey );
free( pBuf );
} else {
Application->MessageBox("Version information not found","CTdir error", MB_OK + MB_ICONERROR );
}
}
 
2ffat, go on John Fill
1c.bmp


ivfmd@mail.md
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top