Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to retrieve version of VREDIR.VXD

20 views
Skip to first unread message

Johan Vanhove

unread,
Jan 2, 2001, 10:42:00 AM1/2/01
to
Hi all,
to prevent databases going corrupt, I would like to verify the version of
VREDIR.VXD at startup of the main application.
(and if vredir is not suitable, give a warning and prevent the user from
doing database updates)
I was looking into the GetFileVersionInfo API-call, but I'm afraid I'm not
able to translate this into VO-code.
Can someone help me out please?

Thanks!

--
Johan Vanhove
CMS NV, Mastboomstraat 4, 2630 Aartselaar, Belgium
Phone: +32 3 870.84.60 Fax: +32 3 870.84.66
E-Mail: C...@Geracc.be - Personal: Johan....@Mail.com


Bernard

unread,
Jan 2, 2001, 1:48:39 PM1/2/01
to
Johan

I have been using a very simple function that seems to be working fine.

FUNCTION VerifyPatch()
// Function to check the latest vRedir patch
LOCAL lReturn := .T. AS LOGIC
LOCAL aDir := {} AS ARRAY

// Win 95?
IF "95"$OS()
// Try a OS directory
adir := Directory(GetOSDir()+"vredir.vxd")
IF !Empty(adir)
IF adir[1][F_DATE] < CToD("1997/09/11")
lReturn := .F.
ENDIF
ENDIF
ENDIF

RETURN lRETURN

--
Regards

Bernard Richard
AvDex - Dedicated Aviation Software
Visit our Website: http://www.avdex.co.za

"Johan Vanhove" <Johan....@vt4.net> wrote in message
news:92st7q$ku2$1...@news0.skynet.be...

Pavel Vetesnik

unread,
Jan 2, 2001, 1:09:45 PM1/2/01
to
Hi Johan,
at www.knowvo.com I've seen VersionInfo class.

HTH,
Pavel

"Johan Vanhove" <Johan....@vt4.net> wrote in message
news:92st7q$ku2$1...@news0.skynet.be...

nsw...@maxis.net.my

unread,
Jan 5, 2001, 10:59:08 AM1/5/01
to
Hi Johan,

I can't see your original post, so I follow Bernard's post.

Below are an example.

For the full source codes, get it at:
http://members.xoom.com/n_s_wong/vo/win32api/verinfo/

Regards,
Wong

Source code for verexe.exe

verinfo/verexe.txt 11-May-00
http://members.xoom.com/n_s_wong
http://www.angelfire.com/ns/nswong

E-mail, Fax, and Tel are user-defined version information
string, not predefined version information string.

verexe.exe
----------
RESOURCE PK ICON pk.ico
RESOURCE VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,5,0,__VERSION__
PRODUCTVERSION 2,5,0,__VERSION__
FILEFLAGSMASK 0x3fL
FILEFLAGS VS_FF_DEBUG|VS_FF_PRERELEASE+;
VS_FF_SPECIALBUILD
FILEOS VOS__WINDOWS32
FILETYPE VFT_APP
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN BLOCK "040904b0"
BEGIN
VALUE "Comments", "Not all are predefined ";
"version information string\0"
VALUE "CompanyName", "PK COMPUTER SERVICES\0"
VALUE "E-mail", "pk...@tm.net.my\0"
VALUE "Fax", "603-6379414\0"
VALUE "FileDescription", ;
"EXE to demonstrate VS_VERSION_INFO\0"
VALUE "FileVersion", "08-Apr-00\0"
VALUE "InternalName", "VS_VERSION_INFO EXE\0"
VALUE "LegalCopyright", ;
"Copyright PKCS\251 1988 - 2000\0"
VALUE "LegalTrademarks", ;
"HRMAS\256 is a trademark of PKCS\0"
VALUE "OriginalFilename", "verexe.exe\0"
VALUE "ProductName", "HRMAS\0"
VALUE "ProductVersion", "2.5a-1\0"
VALUE "SpecialBuild", "For web site example\0"
VALUE "Tel", "603-6378648\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END

PROCEDURE Start()
LOCAL lptstrFilename AS PSZ
LOCAL lpdwHandle AS DWORD PTR
LOCAL dwHandle AS DWORD
LOCAL dwLen AS DWORD
LOCAL lpData AS PTR
LOCAL pBlock AS PTR
LOCAL lpSubBlock AS PSZ
LOCAL lplpBuffer AS PTR
LOCAL lpBuffer AS PTR
LOCAL puLen AS DWORD PTR
LOCAL uLen AS DWORD
LOCAL cCodepageLangID AS STRING
LOCAL wLang AS DWORD
LOCAL szLang AS PTR
LOCAL nSize AS DWORD
lptstrFilename:=String2Psz("verexe.exe")
lpdwHandle:=@dwHandle
dwLen:=GetFileVersionInfoSize(lptstrFilename, lpdwHandle)
lpData:=MemAlloc(dwLen)
GetFileVersionInfo(lptstrFilename, dwHandle, dwLen,;
lpData)
pBlock:=lpData
lpSubBlock:=String2Psz(;
"\StringFileInfo\040904b0\OriginalFilename")
lplpBuffer:=@lpBuffer
puLen:=@uLen
VerQueryValue(pBlock, lpSubBlock, lplpBuffer, puLen)
MessageBox(NULL,lpBuffer,;
String2Psz("VS_VERSION_INFO"),0)
lpSubBlock:=String2Psz("\VarFileInfo\Translation")
VerQueryValue(pBlock, lpSubBlock, lplpBuffer, puLen)
cCodepageLangID:=AsHexString(DWORD(lpBuffer))
MessageBox(NULL,String2Psz(cCodepageLangID),;
String2Psz("VS_VERSION_INFO"),0)
wLang:=WORD(lpBuffer)
szLang:=lpData
nSize:=dwLen
VerLanguageName(wLang,szLang,nSize)
MessageBox(NULL,szLang,;
String2Psz("VS_VERSION_INFO"),0)
MemFree(lpData)
verinfo()
RETURN

0 new messages