Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting EXE/DLL version info
Message
From
10/04/2001 18:42:38
 
 
To
10/04/2001 18:36:44
Jonathan Cochran
Alion Science and Technology
Maryland, United States
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00494206
Message ID:
00494208
Views:
22
>How about:
>
>
>= AGETFILEVERSION( la_FileVersion, 'N:\LIMS\lims.exe' )
>cVersion = la_FileVersion[ 4 ]
>
>

For VFP5, you'd have to use GETFILEVERSION from FOXTOOLS.FLL.



>>I am trying to obtain the version number of my VFP 5.0 EXE. I've got everything working except the most importand of the three API calls. Here's what I got going so far:
>>
>>
>>DECLARE INTEGER GetFileVersionInfoSize in VERSION.DLL ;
>>	String, Integer @
>>DECLARE INTEGER GetFileVersionInfo in VERSION.DLL ;
>>	String, Integer, Integer, String @
>>DECLARE INTEGER VerQueryValue in VERSION.DLL ;
>>	String, String, String @, Integer @
>>
>>cFileName='N:\LIMS\lims.exe'
>>nJunk=0
>>nFVS=GetFileVersionInfoSize(cFileName,@nJunk)
>>
>>cVersionData=space(nFVS)
>>rv=GetFileVersionInfo(cFileName, nJunk, nFVS, @cVersionData)
>>
>>cVersion="             "
>>nValLen=0
>>rv=VerQueryValue(cVersionData, "\StringFileInfo\040904E4\FileVersion", @cVersion, @ValLen)
>>
>>
>>The nValLen contains the correct length of the return value, but the return value is just junk. I displayed the cVersionData to the screen and could decipher the items in the unicode output. The only thing I can figure is I'm not ueing the correct lang-charset mentioned in the help topic for this function (GetFileVersionInfo). You'll notice I'm just using the example from the help file. Anyone been able to pull this off? Do I need to convert the result of the GetFileVersionInfo function back to a normal string (since it's unicode?).
>>
>>Thanks
>>
>>Steve
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform