From: tnewton@cbnco.com on
Hello,

I want to add a function to my DLL to return its file version:

Is there a way to retrieve the file version from the string table
*without* calling GetFileVersionInfo()?

or

Is there a way to *set* the file version in the string table using
another parameter (which I could then retrieve somehow else)?

Thanks in advance,
Terry

From: DavidCrow on
Why are you against using GetFileVersionInfo()?

tnewton(a)cbnco.com wrote:
> Hello,
>
> I want to add a function to my DLL to return its file version:
>
> Is there a way to retrieve the file version from the string table
> *without* calling GetFileVersionInfo()?

From: tnewton@cbnco.com on
Two reasons (one mock indignant, one goofy):

1.) I don't see why the DLL has to go to the file system, given that
the file version number and the function are both inside the DLL
itself.

2.) This DLL is sometimes distributed inside a Java wrapper (don't ask
me why). So, when the function is called from Java, the DLL will no
longer be a file on the disk. (Excuse me if i'm not using the right
terms, I'm not much of a Java programmer.)

Thanks,
Terry

From: Joseph M. Newcomer on
The file version is not in the String table; it is in the VERSIONINFO resource..

Why would you care about using GetFileVersionInfo? It is trivial to use, and it always
does the job right? And it is supported on every version of Windows in existence.

Unless you can add justification as to why this make sense, it sounds a bit like "How can
I add two numbers without using that annoying 'add' instruction?" (Answer: use inc and
dec; for example, to add two positive integers, you inc one while doing a dec on the
other. Generalize to handle correct signs of both operands. But why bother when 'add'
works?)

You can update resources in the binary executable using the resource-update API calls.
There could be good reasons to do this, but you should state the problem you are trying to
solve, instead of asking how to implement an inappropriate solution to an unstated
problem.
joe

On 17 Jun 2005 09:00:00 -0700, "tnewton(a)cbnco.com" <tnewton(a)cbnco.com> wrote:

>Hello,
>
>I want to add a function to my DLL to return its file version:
>
>Is there a way to retrieve the file version from the string table
>*without* calling GetFileVersionInfo()?
>
>or
>
>Is there a way to *set* the file version in the string table using
>another parameter (which I could then retrieve somehow else)?
>
>Thanks in advance,
>Terry

Joseph M. Newcomer [MVP]
email: newcomer(a)flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
From: tnewton@cbnco.com on
The problem I am trying to solve is how get the version without calling
GetFileVersionInfo():

I have a library. I want to use the same version number whether the
library is static or dynamic. Since there's not necessarily a file,
GetFileVersionInfo() will not work.

Thanks,
Terry