Board index » cppbuilder » How to retrieve version info in running program?

How to retrieve version info in running program?

Greetings all,

Sorry if this is the wrong group for this, but none of the others looked
relevant :)

I've set my project to include version information and to increment the
build number automatically, but I would like to be able to have access to
that info inside the running program, for dumping to a logfile, displaying,
etc. I don't want to have to manually update an .rc file, since Builder is
already doing this with the build numbers, etc. How do I access this info
inside a running program? Thanks for any pointers!

Dean@Home

 

Re:How to retrieve version info in running program?


Quote
"Dean@Home" wrote:

> Greetings all,

> Sorry if this is the wrong group for this, but none of the others looked
> relevant :)

WINAPI would be the right.

Quote

> I've set my project to include version information and to increment the
> build number automatically, but I would like to be able to have access to
> that info inside the running program, for dumping to a logfile, displaying,
> etc. I don't want to have to manually update an .rc file, since Builder is
> already doing this with the build numbers, etc. How do I access this info
> inside a running program? Thanks for any pointers!

> Dean@Home

you need the Win API functions GetFileVersionInfoSize(),
GetFileVersionInfo(),
and VerQueryValue() to get the desired information.

Bye Klaus

Other Threads