windowsregistrytypelib

What does it mean to append "\<num>" to file paths under HKCR\TypeLib\<TypeLib>


I've seen several (not all) registry values like the followings, when trying to parse out the file path under the TypeLib registry key:

HKEY_CLASS_ROOT\TypeLib\\{EE9CFA8C-F997-4221-BE2F-85A5F603218F}\1.0\0\win64(Defalt): C:\Program Files (x86)\Microsoft Office\root\VFS\ProgramFilesX64\Microsoft Office\Office16\OCHelper.dll\1

HKEY_CLASS_ROOT\TypeLib\\{F9E34568-0298-46D3-B9C4-19AFB415CBA8}\1.0\0\win32(Default): C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Packages\mswebprj.dll\5

HKEY_CLASS_ROOT\TypeLib\\{F2A7EE29-8BF6-4a6d-83F1-098E366C709C}\1.0\0\win32(Default): C:\Program Files (x86)\Microsoft Office\Root\Office16\ONENOTE.EXE\2

Each file path is appended with a backslash followed a number. Apparently, these file paths are not legal to file system. I'm wondering if anyone recognizes the syntax, and what the appendix means to a typelib registration under these registry key.


Solution

  • usually we use LoadRegTypeLib for load typelib based on registry information. the The function LoadRegTypeLib defers to LoadTypeLib to load the file. and read Remarks section for LoadTypeLib

    By default, the type library is extracted from the first resource of type ITypeLib. To load a different type of library resource, append an integer index to szFile. For example:

    ITypeLib *ptlib;
    LoadTypeLib("C:\\MONTANA\\EXE\\MFA.EXE\\3", &ptlib)
    

    This statement loads the type library resource 3 from the file Mfa.exe file.