0

How do I read the version information (Major, Minor and Revision values) of a COM library (.dll)? Both the executable and the library are Visual Basic 6 projects.

Fábio
  • 3,291
  • 5
  • 36
  • 49
  • 2
    Try the API GetFileVersionInfo function. https://msdn.microsoft.com/en-us/library/windows/desktop/ms647003(v=vs.85).aspx – jac Nov 18 '15 at 23:19
  • 1
    [This answer contains WAY more than you need, but has everything you'd ever want to know.](http://stackoverflow.com/a/1125576/656243) – Lynn Crumbling Nov 19 '15 at 02:49
  • If they are projects you can change add a property returning app.major/minor/revision – Alex K. Nov 19 '15 at 11:17

1 Answers1

0

If you have control of the DLL's source code (you wrote it, for example), you can add methods to expose the App.Major, App.Minor, and App.Revision properties. In your DLL code, add this:

Public Function Major() As String
    Major = App.Major
End Function

In your code that uses the DLL, then:

Public Sub Whatever
    With New myClass
        MsgBox .Major
    End With
End Sub

Make analogous methods for Minor and Revision, and there you are. If you don't have the source code, you have to hope that whoever wrote the DLL did this, or you may have to resort to trying to find something obscure in the link that Lynn shared.

BobRodes
  • 5,990
  • 2
  • 24
  • 26