This is a dll version checker for use inside an application.
Note that it does not include a path to the DLL. by default,
it finds the version of the DLL that has been loaded into
memory by the application. You can modify this code so that
it always displays the version number of the files it checks.
'David Graham. (david) Right to attribution retained.
'Watch for word wrap
Option Compare Database
Option Explicit
Const mcModuleName = "mdlRP_DLLCheck"
'2003/02/26 dlg
Private Declare Function GetFileVersionInfo& Lib "Version" Alias
"GetFileVersionInfoA" (ByVal FileName$, ByVal lptr&, ByVal lSize&, lpvData
As Any)
Public Sub gsbDLLCheck()
If ("4.0.7328.0" > gfn_GetVersion("msjet40.dll")) Then MsgBox "Warning:
MSJET40.dll is " & gfn_GetVersion("msjet40.dll") ' & ", not SP7"
If ("9.0.0.3822" > gfn_GetVersion("msaccess.exe")) Then MsgBox "Warning:
MSACCESS.EXE is " & gfn_GetVersion("msaccess.exe") ' & ", not SR1"
End Sub
Public Function gfn_GetVersion(FileName$)
'2003/02/26 dlg --minimalist version -- Right to attribution retained
Dim iBuf(0 To 99) As Integer
Call GetFileVersionInfo(FileName$, 0&, 200, iBuf(0))
gfn_GetVersion = iBuf(25) & "." & iBuf(24) & "." & iBuf(27) & "." &
iBuf(26) 'FILE VERSION
End Function