🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
4 messages
4 total messages Started by Stephane Baillargeon Tue, 13 May 2003 17:32
GetFileVersionInfo
#16457
Author: Stephane Baillargeon
Date: Tue, 13 May 2003 17:32
2 lines
1045 bytes
Is there a simpler function that returns the file version number or do I
have to absolutely call this big GetFileVersionInfo thingy?
Re: GetFileVersionInfo
#16458
Author: Remy Lebeau (TeamB)
Date: Tue, 13 May 2003 17:50
15 lines
1470 bytes
"Stephane Baillargeon" <sbaillargeon@microids.com> wrote in message
news:3ec12c4e@newsgroups.borland.com...
> Is there a simpler function that returns the file version number
> or do I have to absolutely call this big GetFileVersionInfo thingy?

That is the only function available by the API for that purpose (thus its
name in the first place).

If you want something simplier, then you'll just have to find, download, and
install any of a number of third-party components readily available which
wrap that function internally.


Gambit
Re: GetFileVersionInfo
#16462
Author: Pere Mateu
Date: Tue, 13 May 2003 19:54
26 lines
1846 bytes
Hope this helps,

AnsiString __fastcall GetFileVersion(AnsiString FileName)
{
        int i; unsigned long j; bool b=false;
        unsigned int Major, Minor; AnsiString s="";
        i=GetFileVersionInfoSize(FileName.c_str(),&j);
        if (i>0) {
           char *buff=StrAlloc(i+1);
           if (GetFileVersionInfo(FileName.c_str(),j,i,buff)) {
              void* ffi; unsigned int k;
              if (VerQueryValue(buff,"\\",&ffi,&k)) {
                 Major=((VS_FIXEDFILEINFO*)ffi)->dwFileVersionMS;
                 Minor=((VS_FIXEDFILEINFO*)ffi)->dwFileVersionLS;
                 b=true;
              }
           }
           StrDispose(buff);
        }
        if (b) s=IntToStr(Major/65536)+"."+(Major%65536)+"."+
           IntToStr(Minor/65536)+"."+(Minor%65536);
        return(s);
}

Regards,
P. Mateu
Re: GetFileVersionInfo
#16401
Author: Brent
Date: Thu, 15 May 2003 04:46
15 lines
1494 bytes
Yes it is big and awkard.  If you're not sure how to use it, this link
should help.  (Actually now that I've had another read of the article, it
doesn't really make much sense anymore).

http://www.bridgespublishing.com/articles/issues/0012/Getting_file_version_i
nformation.htm

Brent

"Stephane Baillargeon" <sbaillargeon@microids.com> wrote in message
news:3ec12c4e@newsgroups.borland.com...
> Is there a simpler function that returns the file version number or do I
> have to absolutely call this big GetFileVersionInfo thingy?
>
>
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads