MoVersion Control MoVersion Home
Properties Methods Events Return Codes Example

MoLoadedModules scans through the current process and determines which DLL's are loaded, what location they are being loaded from and finally determine all of the version information for each module.

This collection can easily be used as a diagnostic tool to report the version information of all the DLL's your application is using.



Properties

Property Name Property Description
FileName As String [Read Only] Returns the filename without any path
FullFileName As String [Read Only] Returns the filename with full path. Note the full path is not currently returned for any object data retrieved by GetFileVersionInformation using a relative path.
Description As String [Read Only] Returns the Version Description text attribute from the VersionInfo resource
FileVersion As String [Read Only] Returns the FileVersion text attribute from the VersionInfo resource
FileVersionMS As Long [Read Only] Returns the 32 bit major file version attribute from the VersionInfo resource. The number can be split into two 16 bit numbers that indicate the two top most version identifiers
FileVersionLS As Long [Read Only] Returns the 32 bit minor file version attribute from the VersionInfo resource. The number can be split into two 16 bit numbers that indicate the two bottom most version identifiers
ProductVersion As String [Read Only] Returns the ProductVersion text attribute from the VersionInfo resource
ProductVersionMS As Long [Read Only] Returns the 32 bit major product version attribute from the VersionInfo resource. The number can be split into two 16 bit numbers that indicate the two top most version identifiers
ProductVersionLS As Long [Read Only] Returns the 32 bit minor product version attribute from the VersionInfo resource. The number can be split into two 16 bit numbers that indicate the two bottom most version identifiers
ProductName As String [Read Only] Returns the ProductName text attribute from the VersionInfo resource
Copyright As String [Read Only] Returns the Copyright text attribute from the VersionInfo resource
CompanyName As String [Read Only] Returns the CompanyName text attribute from the VersionInfo resource
InternalName As String [Read Only] Returns the InternalName text attribute from the VersionInfo resource
Language As String [Read Only] Returns a text representation of the LanguageID from the VersionInfo resource
OriginalFilename As String [Read Only] Returns the OriginalFilename text attribute from the VersionInfo resource
LegalTradeMarks As String [Read Only] Returns the LegalTradeMarks text attribute from the VersionInfo resource
PrivateBuild As String [Read Only] Returns the PrivateBuild text attribute from the VersionInfo resource
SpecialBuild As String [Read Only] Returns the SpecialBuild text attribute from the VersionInfo resource
FileSize As Long [Read Only] Returns the size (in bytes) of the selected file
FileDateCreation As DATE [Read Only] Returns the date/time the file was created
FileDateModified As DATE [Read Only] Returns the date/time the file was last modified
FileDateLastAccessed As DATE [Read Only] Returns the date/time the file was last accessed


Methods

Method Name Method Description
GetFileVersionInformation(FileName As String) As Long Loads the version information from the selected file. Note the filename can contain environment variables such as
%WINDIR%.
GetProgIDVersionInformation(ProgID As String) As Long Loads the version information from the selected COM ProgID. An example of a ProdID is:
"License.Manager.1".
GetGUIDVersionInformation(GUID As String) As Long Loads the version information from the selected COM GUID. An example of a GUID is:
"{2FC6F089-F787-11D2-9C50-0020AF149C28}".
ForFreewareUseOnly() As Long This call exists in both the FREEWARE version of the control and the Professional version. This call need only be called in the FREEWARE version to stop the annoying dialog popping up. The reason for this function is too allow Freeware developers to have access to a fully functional control, but remind professional users that the FREEWARE version is only licensed for freeware solutions.


Events

Event Name Property Description
Control does not currently support events N/A


Constants

dwFileOS Constants Value Description
MO_VOS_UNKNOWN 0 The operating system for which the file was designed is unknown to the system.
MO_VOS__WINDOWS16 1 The file was designed for 16-bit Windows.
MO_VOS__PM16 2 The file was designed for 16-bit Presentation Manager.
MO_VOS_PM32 3 The file was designed for 32-bit Presentation Manager.
MO_VOS__WINDOWS32 4 The file was designed for the Win32 API.
MO_VOS_DOS 65536 The file was designed for MS-DOS.
MO_VOS_OS216 131072 The file was designed for 16-bit OS/2.
MO_VOS_OS232 196608 The file was designed for 32-bit OS/2.
MO_VOS_NT 262144 The file was designed for Windows NT.

dwFileType Constants Value Description
MO_VFT_UNKNOWN 0 The file type is unknown to the system.
MO_VFT_APP 1 The file contains an application.
MO_VFT_DLL 2 The file contains a dynamic-link library (DLL).
MO_VFT_DRV 3 The file contains a device driver. If dwFileType is VFT_DRV, dwFileSubtype contains a more specific description of the driver.
MO_VFT_FONT 4 The file contains a font. If dwFileType is VFT_FONT, dwFileSubtype contains a more specific description of the font file.
MO_VFT_VXD 5 The file contains a virtual device.
MO_VFT_STATIC_LIB 7 The file contains a static-link library.

dwFileSubtype Constants
(for DRV types)
Value Description
MO_VFT2_UNKNOWN 0 The driver type is unknown by the system.
MO_VFT2_DRV_PRINTER 1 The file contains a printer driver.
MO_VFT2_DRV_KEYBOARD 2 The file contains a keyboard driver.
MO_VFT2_DRV_LANGUAGE 3 The file contains a language driver.
MO_VFT2_DRV_DISPLAY 4 The file contains a display driver.
MO_VFT2_DRV_MOUSE 5 The file contains a mouse driver.
MO_VFT2_DRV_NETWORK 6 The file contains a network driver.
MO_VFT2_DRV_SYSTEM 7 The file contains a system driver.
MO_VFT2_DRV_INSTALLABLE 8 The file contains an installable driver.
MO_VFT2_DRV_SOUND 9 The file contains a sound driver.
MO_VFT2_DRV_COMM 10 The file contains a communications driver.
MO_VFT2_DRV_INPUTMETHOD 11 The file contains a input method driver.

dwFileSubtype Constants
(for FONT types)
Value Description
MO_VFT2_UNKNOWN 0 The font type is unknown by the system.
MO_VFT2_FONT_RASTER 1 The file contains a raster font.
MO_VFT2_FONT_VECTOR 2 The file contains a vector font.
MO_VFT2_FONT_TRUETYPE 3 The file contains a TrueType font.


Return Codes

Error Code Value Description
MOVER_RC_NO_ERROR 0 No Error has occured.
MOVER_RC_NO_VERSION_INFO_FOUND 1 No Error has occured.
MOVER_RC_FILE_NOT_FOUND 1001 The selected file does not have any embedded version information.
MOVER_RC_GUID_NOT_REGISTERED 1010 The selected COM GUID is not registered in the system.
MOVER_RC_PROGID_NOT_REGISTERED 1011 The selected COM ProgID is not registered in the system.
MOVER_RC_INTERNAL_EXCEPTION_THROWN 1098 This should never been seen! All the Mobiusware controls use Win32 exception handling to ensure your application cannot be killed by any problems in our control. If any problems are caught this error code is returned. Please report any sighting of this error to our support.


Example - Use of MoVersion in VB

Private Sub btnGetInformation_Click()
   Dim myMoVersion As MoVersion
   Dim lRc As Long

   '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
   ' Create a new MoVersion object.                                        '
   '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
   Set myMoVersion = New MoVersion


   '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
   ' Determine component version using filename.                           '
   '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
   myMoVersion.ForFreewareUseOnly
   Debug.Print "Attempting to determine version of %WINDIR%\Notepad.exe"
   lRc = myMoVersion.GetFileVersionInformation("%WINDIR%\Notepad.exe")
   If (lRc = 0) Then
      Debug.Print myMoVersion.FileName & " has Version information"
      Debug.Print "CompanyName    : " & myMoVersion.CompanyName
      Debug.Print "Description    : " & myMoVersion.Description
      Debug.Print "FileVersion    : " & myMoVersion.FileVersion
      Debug.Print "ProductVersion : " & myMoVersion.ProductVersion
      Debug.Print "ProductName    : " & myMoVersion.ProductName
      Debug.Print "Copyright      : " & myMoVersion.Copyright
      Debug.Print "InternalName   : " & myMoVersion.InternalName
      Debug.Print "Language       : " & myMoVersion.Language
      Debug.Print "OrigFileName   : " & myMoVersion.OriginalFileName
      Debug.Print "CompanyName    : " & myMoVersion.CompanyName
      Debug.Print "LegalTradeMarks: " & myMoVersion.LegalTradeMarks
      Debug.Print "PrivateBuild   : " & myMoVersion.PrivateBuild
      Debug.Print "SpecialBuild   : " & myMoVersion.SpecialBuild
   Else
      Debug.Print myMoVersion.FileName & " does not have Version information"
   End If


   '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
   ' Determine component version using ProgID.                             '
   '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
   myMoVersion.ForFreewareUseOnly
   Debug.Print "Attempting to determine version of MoVersion.MoVersion.1"
   lRc = myMoVersion.GetProgIDVersionInformation("MoVersion.MoVersion.1")
   If (lRc = 0) Then
      Debug.Print myMoVersion.FileName & " has Version information"
      Debug.Print "FullFileName   : " & myMoVersion.FullFileName
      Debug.Print "Description    : " & myMoVersion.Description
      Debug.Print "FileVersion    : " & myMoVersion.FileVersion
      Debug.Print "ProductVersion : " & myMoVersion.ProductVersion
      Debug.Print "ProductName    : " & myMoVersion.ProductName
      Debug.Print "Copyright      : " & myMoVersion.Copyright
      Debug.Print "InternalName   : " & myMoVersion.InternalName
      Debug.Print "Language       : " & myMoVersion.Language
      Debug.Print "OrigFileName   : " & myMoVersion.OriginalFileName
      Debug.Print "CompanyName    : " & myMoVersion.CompanyName
      Debug.Print "LegalTradeMarks: " & myMoVersion.LegalTradeMarks
      Debug.Print "PrivateBuild   : " & myMoVersion.PrivateBuild
      Debug.Print "SpecialBuild   : " & myMoVersion.SpecialBuild
   Else
      Debug.Print "MoVersion.MoVersion.1 does not have Version information"
   End If

   '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
   ' Determine component version using GUID.                               '
   '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
   myMoVersion.ForFreewareUseOnly
   Debug.Print "Attempting to determine version of {2FC6F089-F787-11D2-9C50-0020AF149C28}"
   lRc = myMoVersion.GetGUIDVersionInformation("{2FC6F089-F787-11D2-9C50-0020AF149C28}")
   If (lRc = 0) Then
      Debug.Print myMoVersion.FileName & " has Version information"
      Debug.Print "FullFileName   : " & myMoVersion.FullFileName
      Debug.Print "Description    : " & myMoVersion.Description
      Debug.Print "FileVersion    : " & myMoVersion.FileVersion
      Debug.Print "ProductVersion : " & myMoVersion.ProductVersion
      Debug.Print "ProductName    : " & myMoVersion.ProductName
      Debug.Print "Copyright      : " & myMoVersion.Copyright
      Debug.Print "InternalName   : " & myMoVersion.InternalName
      Debug.Print "Language       : " & myMoVersion.Language
      Debug.Print "OrigFileName   : " & myMoVersion.OriginalFileName
      Debug.Print "CompanyName    : " & myMoVersion.CompanyName
      Debug.Print "LegalTradeMarks: " & myMoVersion.LegalTradeMarks
      Debug.Print "PrivateBuild   : " & myMoVersion.PrivateBuild
      Debug.Print "SpecialBuild   : " & myMoVersion.SpecialBuild
   Else
      Debug.Print "{2FC6F089-F787-11D2-9C50-0020AF149C28} does not have Version information"
   End If

   '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
   ' Ensure the MoVersion object is released properly.                     '
   '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
   Set myMoVersion = Nothing
End Sub