Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Retrieving the EXE version
Message
 
À
02/04/1998 05:21:38
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00088701
Message ID:
00088899
Vues:
82
>Snip...
>>Part of the problem is that the version information is in Unicode. This is one of the reasons I didn't get much further than what follows:
>>
DECLARE INTEGER GetFileVersionInfoSize IN Version;
>>  STRING @lptstrFilename, INTEGER @dwHandle
>>DECLARE SHORT GetFileVersionInfo IN Version;
>>  STRING @lptstrFilename, INTEGER dwHandle,;
>>  INTEGER dwLen, STRING @lpData
>>* lcfile is the file name
>>* lnhandle can be any value
>>lnhandle = 99
>>* Get the block size
>>lnsize = GetFileVersionInfoSize(@lcfile, @lnhandle)
>>lcbuffer = SPACE(lnsize)
>>* lnresult will not equal zero if the function succeeds
>>lnresult = GetFileVersionInfo(@lcfile, lnhandle, lnsize, @lcbuffer)
>>If you want to pursue this, look also at VerQueryValue and VerLanguageName functions (also in Version).
>>
>>hth,
>Thanks George. This one works and now mine too. The missing piece was lcBuffer, BUFLEN (mistakenly set less than needed). One more question. Where is the list of parameter types ? (I mean integer, short, string etc and not LPTSTR, LPDWORD etc).
>Thanks again
>Cetin

The references are C/C++ and Windows conventions (declarations such as hWnd). Unfortunately, I don't know of any list per se. Since we're working from different references, (you from Win32api.hlp and me from Win32.hlp), I don't know that your declarations are the same as mine. Mine have comments in them that pretty much make it pretty clear what's what. For example, here's the actual C++ declaration of the above:
BOOL GetFileVersionInfo(
  LPTSTR lptstrFilename, // pointer to filename string
  DWORD  dwHandle, // ignored
  DWORD  dwLen, // size of buffer
  LPVOID lpData // pointer to buffer to receive file-version info.
  );
From the above, it's pretty easy to determine what each of the parameters is.

Other than this, if you see the letters LP as a prefix, it stands for "Long Pointer" and the parameter should be passed by reference. DWORDs and LONGs are integer are integers, WORDs are short integers. Since VFP does have a declaration type that exactly matches BOOL, I use a SHORT (it's a convention I use) to indicate that it's a Boolean value. The return value will be zero if the function fails.

hth,
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform