Results 1 to 5 of 5

Thread: [RESOLVED] How do I get a DLL file version in VB6?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2006
    Location
    Montreal, Quebec
    Posts
    27

    Resolved [RESOLVED] How do I get a DLL file version in VB6?

    Hello poeple,

    I have been coming to this site for over a year and for the first time, I cannot find the answer using the search feature...

    I am creating a small Client/Server app that will run before my main app and verify that all of the client files are of the latest version by comparing the dll list of the client to a list on the server...

    I found out using an hex editor that the version is stored at 114h & 115h for the major and 116h & 117h for the minor

    is there an easier way to get the version of the file without opening it in text and extracting the info?

    Thanks a bunch!

  2. #2
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: How do I get a DLL file version in VB6?

    You should use the GetFileVersionInfo API function. I don't know if it's easier but it's definitely a more reliable way of getting the file version compared to reading fixed bytes in the file.

    Resources:
    http://vb.mvps.org/samples/project.asp?id=fileinfo
    http://vb-helper.com/howto_file_version_info.html

  3. #3
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: How do I get a DLL file version in VB6?

    if you don't fancy implementing the API yourself then you can use fso:
    VB Code:
    1. ' Requires reference to Microsoft Scripting Runtime
    2. Dim fso As FileSystemObject
    3. Set fso = New FileSystemObject
    4. Debug.Print fso.GetFileVersion("C:\windows\system32\comctl32.dll")
    5. Set fso = Nothing

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Aug 2006
    Location
    Montreal, Quebec
    Posts
    27

    Re: How do I get a DLL file version in VB6?

    Great Bushmobile, I cant test it right now but it really sounds like what I needed

    Thanks a bunch

  5. #5
    New Member
    Join Date
    Jun 2017
    Posts
    1

    Re: How do I get a DLL file version in VB6?

    Thank you Bushmobile... Great refresher! Thanks for posting this! Yeah... still maintaining a VB 6.0 application since 2010! LOL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width