Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
File Version
Message
General information
Forum:
Visual C++
Category:
Other
Title:
Miscellaneous
Thread ID:
00561100
Message ID:
00562414
Views:
20
Hi!
You nedd to add Version.lib to libraries on Link tab of Project options.
Or add
pragma comment(lib,"Version.lib")
to source file.
You can also try this sample:
DWORD dwVerHnd;
DWORD dwVerInfoSize = ::GetFileVersionInfoSize (szFullPath, &dwVerHnd);
if (dwVerInfoSize == 0)
{
	return FALSE; 
}
// If we were able to get the information, process it:
HANDLE  hMem;
LPVOID  lpvMem;
hMem = ::GlobalAlloc (GMEM_MOVEABLE, dwVerInfoSize);
lpvMem = ::GlobalLock (hMem);
::GetFileVersionInfo (szFullPath, dwVerHnd, dwVerInfoSize, lpvMem);

BOOL  bRet;
UINT  cchVer = 0;
LPSTR lszVer = NULL;
bRet = ::VerQueryValue (lpvMem, TEXT("\\StringFileInfo\\040904B0\\ProductVersion"), (LPVOID*) &lszVer, &cchVer);
if (bRet && cchVer && lszVer)
{ 
	strOut = lszVer;
} 
::GlobalUnlock(hMem);
::GlobalFree(hMem);
>Yeah... I saw that, but couldn't get it to compile. Forgive me, but I haven't used C/C++ in 5 years. When I try to compile I get an error:
>
>error LNK2001: unresolved external symbol _GetFileVersionInfoA@16
Previous
Reply
Map
View

Click here to load this message in the networking platform