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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Version Info

Status
Not open for further replies.

fiver1

Programmer
Oct 11, 2000
10
US
How do I extract the Version Info (ie. 2.2.1.54) to display on a form such as an About box?
 
One way is to call a Windows API function. If noboy can come up with a better solution in a couple of days, I dig out my notes and post them here.
James P. Cottingham
 
Well, nobody has posted anything, so I'll give it a try. I was hoping to get an example but I haven't had time. The only exmaple that I've found was at Borland's ite in their Community but it was in Pascal (Delphi). You need to call three Windows APIs:
DWORD GetFileVersionInfoSize(
LPTSTR lptstrFilename, // file name
LPDWORD lpdwHandle // set to zero
);

If the value return by this is zero, then it failed and you can't get the version.

BOOL GetFileVersionInfo(
LPSTR
lptstrFilename, // file name (same as above)
DWORD dwHandle, // ignored
DWORD dwLen, // size of buffer from above API
LPVOID lpData // version info buffer
)

Then you call:
DWORD GetFileVersionInfoSize(
LPTSTR
lptstrFilename, // file name (same as above)
LPDWORD lpdwHandle // set to zero
)

See msdn.microsoft.com/libary and search for these APIs for more info. Sorry I can't be of more help.
James P. Cottingham
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top