7

MS' docs simply say:

Given a ProgID, CLSIDFromProgID looks up its associated CLSID in the registry.

But where exactly does it look? I have a weird issue where a wrong CLSID is being returned and I want to follow where this function is looking to help narrow down where the problem is.

Mr. Boy
  • 60,845
  • 93
  • 320
  • 589
  • It looks in HKCR\progid\CLSID where "progid" is your ProgId string. It was already clear from your other question that in all likelihood your registration code is broken. – Hans Passant Nov 16 '12 at 13:16

1 Answers1

6

The lookup goes through the application's manifest and its dependant assembly manifests. This is done to support registration-free COM.

If there's no application manifest or if none of the dependant assembly manifests declare your class in a comClass or clrClass XML element, the lookup defaults to the registry, which will check HKEY_CLASSES_ROOT\<ProgID>1 with a string value named CLSID.


1. HKEY_CLASSES_ROOT is a mix of HKEY_CURRENT_USER\Software\Classes and HKEY_LOCAL_MACHINE\Software\Classes.

Community
  • 1
  • 1
acelent
  • 7,965
  • 21
  • 39