Discussion:
GetFileVersionInfoSize() problem
(too old to reply)
Jim Barry
2004-07-20 11:34:42 UTC
Permalink
GetFileVersionInfoSize() is failing for me with GetLastError()
returning 1814 "The specified resource name cannot be found
in the image file. "
Can anyone offer any guidance here? Im not sure what this is
trying to tell me and how I resolve the issue.
Errr, no version resource in specified file?
--
Jim Barry, MVP for Windows SDK
dice
2004-07-20 12:09:03 UTC
Permalink
I dont know much about resource files as I never use them, but in this particular project I have included a VS_VERSION_INFO resource and have not modified any of the default values in it.

The app is attempting to get the versioninfo for itself - see below, this really cant be any simpler so Im obviously missing something pretty basic

#include "stdafx.h"

int WINAPI WinMain( ...)
{
//LPTSTR filename = _T("\\Test\\test2.exe");
LPTSTR filename = _T("test2.exe");
DWORD dwSetZero,dwRetVal;

LPVOID lpData;

dwRetVal = GetFileVersionInfoSize(filename,&dwSetZero);

if( 0 == dwRetVal )
{
printf("Can't get File Version Info Size (Error %d)",GetLastError());
}
Post by Jim Barry
GetFileVersionInfoSize() is failing for me with GetLastError()
returning 1814 "The specified resource name cannot be found
in the image file. "
Can anyone offer any guidance here? Im not sure what this is
trying to tell me and how I resolve the issue.
Errr, no version resource in specified file?
--
Jim Barry, MVP for Windows SDK
Helge Kruse
2004-07-22 15:38:16 UTC
Permalink
Check that the version info in the .EXE (or .DLL) has the id 1 and not 0.
You can do this simply with the Windows Explorer context menu. It will not
show the version info, if you have the problem below. But I dont remember,
if this problem was in the eVC++ 3.0 or Platform Builder 3.0 enviroment.

I had this problem as a built a non-MFC DLL. The include files, that are
included in the .RC file does not contain the
#define VS_VERSION_INFO 1
so you get a different resource id (0). The solution was to include the
appropriate .H files.

/Helge
Helge Kruse
2004-07-22 15:38:16 UTC
Permalink
Check that the version info in the .EXE (or .DLL) has the id 1 and not 0.
You can do this simply with the Windows Explorer context menu. It will not
show the version info, if you have the problem below. But I dont remember,
if this problem was in the eVC++ 3.0 or Platform Builder 3.0 enviroment.

I had this problem as a built a non-MFC DLL. The include files, that are
included in the .RC file does not contain the
#define VS_VERSION_INFO 1
so you get a different resource id (0). The solution was to include the
appropriate .H files.

/Helge
Helge Kruse
2004-07-26 15:42:51 UTC
Permalink
In most projects I only need the version resource. So I decided to edit the
file manually and define the symbol in the .RC file.
You will have to make your own decision.

/Helge

Loading...