• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 430
  • Last Modified:

Using The MSVC Version Resource (VS_VERSION_INFO)

Okay. The version resource is there, but how do I get the info out of it to display to a user on a dlg? Specifically the LegalCopyright info. . . I'm probably overlooking something simple and quick where MS named the function something obscure. Thanks.
0
maknight
Asked:
maknight
1 Solution
 
MFCGuyCommented:
//Here's how I got the product version
//You question should be very similar...

DWORD dwBuffSize = ::GetFileVersionInfoSize((char*)LPCTSTR(fileName),&dwHandle);
if( ::GetFileVersionInfo((char*)LPCTSTR(fileName), 0, dwBuffSize, (LPVOID)szBuff ) )
{
   if( dwBuffSize && ::VerQueryValue(szBuff,                                                                              "\\StringFileInfo\\040904B0\\ProductVersion",                                                                  &lpInfo,                                                            (UINT*)&cch) )
//do something with the value                                    
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now