How COM registration works in Windows

I am an application package trying to understand how COM registry keys (SelfReg) are related to a given .dll in Windows.

Are ProgID, AppID, TypeLibs, extensions and verbs linked directly to CLSID? Should the CLSID always use Prog / App identifiers or do you only have a file extension class? Which bits are optional?

Some of them seem "router-like" where there are two interfaces (internal -.dll) and external (extension, etc.).

How does all this fit? (SDK documentation doesn't make sense to me)

I ask, since all this is key for the healing application with the Windows installer (which packages are all "large", but there are no insignificant failures, since this is actually an encoder)

--- Edit: I am sure that for COM to be registered, it must all refer to the CLSID and cannot be a "dead end"? Verbs need extensions that need prog ...

What about AppId, TypeLibs and interfaces? How are they interconnected?

+6
windows com registry
source share
3 answers

The first thing to understand is that COM DLLs are registered. They put all the necessary entries in the correct places in the registry.

I think the answer to your central question about which bits are optional is likely that they are all optional for different types of objects. Automation objects require a Prog / AppID if they are publicly available, but cannot, if they are created only internally, a non-public COM class can be specified similarly.

Many COM objects that do not have automation interfaces (for example, many of the COM classes that Microsoft uses inside Windows will not have a ProgId, but will simply have an entry under their CLSID in HKCR \ CLSID.

If I understand you correctly, you are interested in this from the point of view of the installer. I would suggest that all you need to do is ask the user to specify which DLL files are registered themselves, and then call

regsvr32 dllname.dll

or

exename.exe / Regserver

for the processing server. If something goes wrong, you just need to call the opposites.

regsvr32 / u dllname.dll

or

exename.exe / Unregserver

I hope this answers your question.

+4
source share

I would recommend the book Inside COM .

This wasn’t the most relevant link even during the COM distribution, but it explains the basics pretty well , including the entire goo registry . Plus, I bet you can get a used copy really cheap.

I know that this is not an answer, but remembering what the chapter on the registry looked like - the non-specific question β€œhow does it work” will require a really, very long answer ...

+1
source share

I used the answer because the comments seem so limited. Not sure how SO interprets this (maybe I will be deemed insane to talk to myself?)

"how does it work" question will require a really, very long answer

Thank you for trying to understand this understanding of this, without actually being a developer - this is because packages are trying to group COM registry keys with .dll (in the same component) to make the application fault tolerant.

This means capturing COM from registering a .dll and linking it in the correct advertisement tables (CLSID, AppID ... ad nauseum) to the component that contains the .dll. Sometimes it’s not easy to see, and sometimes (I say) it can disrupt the application. I was told that COM is not needed to be self-referential.

I'm still trying to get around all this. Of course, if the packer captures all the information, but does not bind the COM information with the .dll, regkeys are still written during installation, just MSI is not suitable for the application if something goes wrong (which almost never happens)

0
source share

All Articles