Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to get the translation code from VerQueryValue?
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
How to get the translation code from VerQueryValue?
Miscellaneous
Thread ID:
00993793
Message ID:
00993793
Views:
104
Hi,

Can anyone help me find the translation code for the stringFileInfo, I have the following code but i keep getting error message like
--specified resource type cannot be found in the image file--
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 @
DECLARE INTEGER GetLastError IN kernel32
fileName = "C:\PROGRAM FILES\MICROSOFT VISUAL FOXPRO 9\VFP9.EXE"
dwHandle = 0
nDataLen = GetFileVersionInfoSize(fileName, dwHandle)
lpData = SPACE(nDataLen)
GetFileVersionInfo(fileName, dwHandle, nDataLen, @lpData)
subblock = "\VarFileInfo\Translation"
lpblockData = SPACE(nDataLen)
nblockLength = 0
VerQueryValue(lpData, subblock, @lpblockData, @nblockLength)
subblock = "\StringFileInfo\"
         + RIGHT(TRANSFORM(ASC(SUBSTR(lpblockData, 2, 1)), "@0"), 2)
         + RIGHT(TRANSFORM(ASC(SUBSTR(lpblockData, 1, 1)), "@0"), 2)
         + RIGHT(TRANSFORM(ASC(SUBSTR(lpblockData, 4, 1)), "@0"), 2)
         + RIGHT(TRANSFORM(ASC(SUBSTR(lpblockData, 3, 1)), "@0"), 2) + "\ProductName"
lpblockData = SPACE(nDataLen)
nblockLength = 0
VerQueryValue(lpData, subblock, @lpblockData, @nblockLength)
GetLastError()
Next
Reply
Map
View

Click here to load this message in the networking platform