Getting information about DLL

Hello,

How can I get information about a DLL files: comments, compayname, internal name, language, etc?
LVL 1
slaviknAsked:
Who is Participating?
 
rpaiCommented:
You could use the App object to retrieve the DLL information. i.e App.Comments ; App.CompanyName ; App.Title

0
 
rpaiCommented:
While you are here, please update your other questions:-
Questions Asked 18
Last 10 Grades Given A A A A A A A A A A  
Question Grading Record 13 Answers Graded / 13 Answers Received

Thanks!
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

 
slaviknAuthor Commented:
> You could use the App object to retrieve the DLL information.
How do I do that?


> While you are here, please update your other questions.
What do you mean? There are still unanswered questions.
0
 
rpaiCommented:
Simply use this:-
Debug.Print App.Comment & vbtab & App.CompanyName
in your DLL whose Comments and CompanyName you wish to find.
Hope that answers your question.
0
 
rpaiCommented:
Please use the above statement only when running in the debug mode so that you see what is returned by App.Comment
and other properties

0
 
rpaiCommented:
0
 
nichiaCommented:
"While you are here, please update your other questions:-
Questions Asked 18 "

That's not a bad record, rpai.
Only 5 open questions: 1 in CS, 3 from yesterday and today, and 1 which was self-resolved dating less than a month ago.
0
 
slaviknAuthor Commented:
I was not clear. Sorry. I mean that I have a DLL file (somewhere). From my VB application I want to read information about that DLL file.

How can I do it?
0
 
rpaiCommented:
slavikn, Do you have access to the DLL?
So within the DLL you can create you own Public Methods.
For instance your DLL has ProgID myProj.myCls.

Within myProj.myCls you could write:-
-------------------DLL Component---------------------------
Public Function GetCommentInfo()as String
   App.Comment
End Function

Public Function GetCompanyName()as String
   App.CompanyName
End Function

'-- And so on
-------------------End DLL Component-----------------------


Now when you call the DLL from your application, you could easily retrieve the details:-
-------------------Test Application------------------------
Dim objDLL As Object
Dim sComments As String
Dim sCompanyName As String

Set objDLL =  CreateObject("myProj.myCls")
sComments = objDLL.GetCommentInfo
sCompanyName = objDLL.GetCompanyName
'-- And so on
-------------------End Test Application--------------------

Cheers!
0
 
slaviknAuthor Commented:
I don't have access to the DLL.
0
 
rpaiCommented:
You did not specify that you wish to get the information of the 'remote' DLL in your original question!!
I am not sure if there a way to accomplish this if you cannot access the DLL. Sorry I cannot help you further!
0
 
slaviknAuthor Commented:
I can access it. It is on my computer. I mean that I cannot modify it. Ok?
0
 
Richie_SimonettiIT OperationsCommented:
You could modify it but not with VB. You could use an external tool (excellent Borland Resource workshop)
What info do you want to change?
0
 
slaviknAuthor Commented:
I wasn't clear again. I want to give my VB application to people and they will use it to read a specific DLL's information.
0
 
Richie_SimonettiIT OperationsCommented:
You could show properties dialog box, is it enought?

Option Explicit
Private Type SHELLEXECUTEINFO
    cbSize As Long
    fMask As Long
    hWnd As Long
    lpVerb As String
    lpFile As String
    lpParameters As String
    lpDirectory As String
    nShow As Long
    hInstApp As Long
    lpIDList As Long
    lpClass As String
    hkeyClass As Long
    dwHotKey As Long
    hIcon As Long
    hProcess As Long
  End Type
 
  Private Declare Function ShellExecuteEx Lib "shell32" (lpSEI As SHELLEXECUTEINFO) As Long
 
  Private Const SEE_MASK_INVOKEIDLIST = &HC
 
  Private Sub Form_Click()
    Call ShowFileProperties( _
      "c:\winnt\system32\msvbvm60.dll")
  End Sub
 
  Private Sub ShowFileProperties(ByVal aFile As String)
    Dim sei As SHELLEXECUTEINFO
    sei.hWnd = Me.hWnd
    sei.lpVerb = "properties"
    sei.lpFile = aFile
    sei.fMask = SEE_MASK_INVOKEIDLIST
    sei.cbSize = Len(sei)
    ShellExecuteEx sei
  End Sub
0
 
rpaiCommented:
If you need only the Version Information of the DLL then
you could use something like this:-

----------------BEGIN TEST APP----------------------------
Option Explicit

Private Type VS_FIXEDFILEINFO
    dwSignature As Long
    dwStrucVersion As Long
    dwFileVersionMSl As Integer
    dwFileVersionMSh As Integer
    dwFileVersionLSl As Integer
    dwFileVersionLSh As Integer
    dwProductVersionMSl As Integer
    dwProductVersionMSh As Integer
    dwProductVersionLSl As Integer
    dwProductVersionLSh As Integer
    dwFileFlagsMask As Long
    dwFileFlags As Long
    dwFileOS As Long
    dwFileType As Long
    dwFileSubtype As Long
    dwFileDateMS As Long
    dwFileDateLS As Long
End Type

Private Declare Function GetFileVersionInfo _
    Lib "Version.dll" Alias _
    "GetFileVersionInfoA" (ByVal lptstrFilename _
    As String, ByVal dwHandle As Long, ByVal _
    dwLen As Long, lpData As Any) As Long

Private Declare Function _
    GetFileVersionInfoSize Lib "Version.dll" _
    Alias "GetFileVersionInfoSizeA" (ByVal _
    lptstrFilename As String, lpdwHandle As _
    Long) As Long

Private Declare Sub CopyMemory Lib "kernel32" _
    Alias "RtlMoveMemory" (dest As Any, src As _
    Long, ByVal length As Long)

Private Declare Function VerQueryValue Lib _
    "Version.dll" Alias "VerQueryValueA" _
    (pBlock As Any, ByVal lpSubBlock As String, _
    lplpBuffer As Any, puLen As Long) As Long

Public Function GetVersionInfo(ByVal sFile As _
    String) As String

    Dim lDummy As Long
    Dim sBuffer() As Byte
    Dim lBufferLen As Long, lVerPointer As Long
    Dim lVerBufferLen As Long
    Dim udtVerBuffer As VS_FIXEDFILEINFO
   
    'Default return value
    GetVersionInfo = "N/A"
   
    'Attempt to retrieve version resource
    lBufferLen = GetFileVersionInfoSize(sFile, _
    lDummy)
   
    If lBufferLen > 0 Then
       
        ReDim sBuffer(lBufferLen)
       
        If GetFileVersionInfo(sFile, 0&, _
            lBufferLen, sBuffer(0)) <> 0 Then
           
            If VerQueryValue(sBuffer(0), _
                "\", lVerPointer, lVerBufferLen) _
                <> 0 Then
       
                CopyMemory udtVerBuffer, ByVal _
                    lVerPointer, Len(udtVerBuffer)
                   
                With udtVerBuffer
                    GetVersionInfo = _
                        .dwFileVersionMSh & "." & _
                        .dwFileVersionMSl & "." & _
                        .dwFileVersionLSh & "." & _
                        .dwFileVersionLSl
                End With
       
            End If
        End If
    End If

End Function

Private Sub Command1_Click()
Debug.Print GetVersionInfo("C:\myPath\myTest.dll")
End Sub
------------------END TEST APP----------------------------
0
 
slaviknAuthor Commented:
Richie_Simonetti,
A dialog is not enough. I want to show it in my own window.

rpai,
I need all the information which is available from the "Version" tab in the file's properties.

0
 
slaviknAuthor Commented:
Points: 20 >> 23. I hope this will encourage you  :-)
0
 
slaviknAuthor Commented:
Thanks!
I knew that giving 3 points more will help  :-)
0
 
Richie_SimonettiIT OperationsCommented:
Thanks for "A" grade but please, don't push me
:)
0
 
slaviknAuthor Commented:
I was just kidding  :-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.