in reply to Extract CLSID from unregistered DLL

According to a quick look on Google, you have to use LoadTypeLibEx (with regkind set to NONE) to load the DLL and get its ITypeLib interface.

If you just want to make sure that the DLL is registered, maybe just use regsvr.exe or the RegisterType call.

Replies are listed 'Best First'.
Re^2: Extract CLSID from unregistered DLL
by reinaldo.gomes (Beadle) on Dec 24, 2016 at 11:37 UTC
    Calling regsvr32 or anything else that actually registers the dll is not a safe option.

    I have a few hundreds servers. Each one have dozens of DLLs. Every server is updated somewhat weekly, and most DLLs are changed/updated.

    Given this scenario, I have to make sure every last one of them is actually registered and up to date. I can't simply look for them in the registry by name, because it only tells me whether or not there is a DLL registered with that given name, not necessarily that new file I just copied with the same name.

    The LoadTypeLibEx/ITypeLib method looks primising, since it's just checking the file, but I'm not sure how to use it.

      Note that LoadTypeLibEx will not be "just check" the file, it will also load that library into memory and execute some code from the library.

      Using it likely consists of using Win32::API to load the function call and then supplying the correct parameters to the imported function.

      I have not used LoadTypeLibEx, so your guess is as good as mine, but Microsoft provided some documentation on how to use the things.