Jump to content
Sign in to follow this  
wsabourin

Determining if a DLL / OCX have been registered by file name?

Recommended Posts

wsabourin

Hello there,

Currently I am in the process of a writing a test tool that will check that an installation package has correctly been deployed. This includes checking files, registry, services and other aspects of the deployed package which is almost complete, however I have encountered one large snag determining if a file (dll/ocx) has been registered.

I have searched for the past day for some sort of real solution but I have had little luck and would really love a snip it that takes a file name and checks to see if it has been registered on the current system using AutoIT. The key factor is I do not have direct access to the CLSID or class name directly unless I start popping open code for ever component we have here. I was hoping for a simple solution if possible? Any help would be welcome.

Share this post


Link to post
Share on other sites
StSchnell

Hello wsabourin,

load from internet the ActiveX DLL tlbinf32.dll and register it on your computer with regsvr32. Now you can use this VBS to get more information about an ActiveX DLL:

'-Begin-----------------------------------------------------------------
  Dim t, tl
  Set t = CreateObject("TLI.TLIApplication") 
  Set tl = t.TypeLibInfoFromFile("D:\Dummy\tlbinf32.dll")

  MsgBox tl.GUID

'-End-------------------------------------------------------------------

Or nearly the same in AutoIt:

;-Begin-----------------------------------------------------------------

  Dim $ta, $ti, $Str
  $ta = ObjCreate("TLI.TLIApplication")

  If IsObj($ta) Then
    $ti = $ta.TypeLibInfoFromFile("D:\Dummy\TlbInf32.dll")

    $Str = $ti.GUID & @CR & @LF
    $Str = $Str & $ti.HelpString & @CR & @LF
    $Str = $Str & $ti.Name & @CR & @LF
    $Str = $Str & $ti.ContainingFile & @CR & @LF

    MsgBox(0, "GUID", $Str)

  EndIf

;-End-------------------------------------------------------------------

Search about TLI.TLIApplication in this forums and you get some examples and discussions.

If you need more information about tlbinf32.dll load from Microsoft the help file.

Hope it helps.

Cheers

Stefan

Edited by StSchnell

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.