Gus Vincent Dato wrote:
> tried this.
>
> void main()
> {
> DWORD Egfv;
> DWORD gfvHandle;
> DWORD gfvLen = GetFileVersionInfoSize("d:\\d\\setup.exe", &gfvHandle);
> LPVOID lpData = new char[gfvLen];
> Egfv=GetFileVersionInfo("d:\\d\\setup.exe", gfvHandle, gfvLen, lpData);
> cout << lpData;
> }
>
> however, im running some compilation errors.
>
> 1>main.obj : error LNK2019: unresolved external symbol
> _getfileversionin...@16 referenced in function _main
> 1>main.obj : error LNK2019: unresolved external symbol
> _getfileversioninfosi...@8 referenced in function _main
> 1>C:\Users\gus\Documents\Visual Studio 2008\Projects\808\Debug\808.exe :
> fatal error LNK1120: 2 unresolved externals
>
> gus
From MSDN Library:
---
Function Information
Minimum DLL Version version.dll
Header Declared in Winver.h, include Windows.h
Import library Version.lib
^^^^^^^^^^^^^^^^^^^^^^^^^^
Minimum operating systems Windows 95, Windows NT 3.1
Unicode Implemented as ANSI and Unicode versions.
---
You need to add version.lib to your project's linker options.
You can't just output lpData. You MUST access the information using
VerQueryValue() as the documentation states. You are accessing the
resource directory of the NE/PE file format. This isn't just something
you can simply write out using cout. You need to walk the potential
tree of information (this is potentially a multilingual resource).
--
Thomas Hruska
CubicleSoft President
Ph: 517-803-4197
*NEW* MyTaskFocus 1.1
Get on task. Stay on task.
http://www.CubicleSoft.com/MyTaskFocus/