-----------------------------------------------
                       LOADREGTYPELIB AND OLE AUTOMATION
                                 January 2017
                 -----------------------------------------------
                                    CCB



1. THE LOADREGTYPELIB WINDOWS API:

     HRESULT LoadRegTypeLib(
       REFGUID rguid,
       WORD wVerMajor,
       WORD wVerMinor,
       LCID lcid,
       ITypeLib **pptlib
     );


2. REFERENCE CODE:

     In x86, there are OLE Automation 1.0 and OLE Automation 2.0 type libraries.

     In x64, there is only OLE Automation 2.0 type library, there is no OLE Automation 1.0 type library.
     If we try to load OLE Automation 1.0 type library from the system registry, it will return an error.


3. REFERENCE REGISTRY DATA:

     [HKEY_CLASSES_ROOT\TypeLib\{00020430-0000-0000-C000-000000000046}]

     [HKEY_CLASSES_ROOT\TypeLib\{00020430-0000-0000-C000-000000000046}\1.0]
     @="OLE Automation"
     [HKEY_CLASSES_ROOT\TypeLib\{00020430-0000-0000-C000-000000000046}\1.0\0]
     [HKEY_CLASSES_ROOT\TypeLib\{00020430-0000-0000-C000-000000000046}\1.0\0\win32]
     @="C:\\Windows\\system32\\stdole32.tlb"
     [HKEY_CLASSES_ROOT\TypeLib\{00020430-0000-0000-C000-000000000046}\1.0\FLAGS]
     @="1"
     [HKEY_CLASSES_ROOT\TypeLib\{00020430-0000-0000-C000-000000000046}\1.0\HELPDIR]
     @=""

     [HKEY_CLASSES_ROOT\TypeLib\{00020430-0000-0000-C000-000000000046}\2.0]
     @="OLE Automation"
     "PrimaryInteropAssemblyName"="stdole, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
     [HKEY_CLASSES_ROOT\TypeLib\{00020430-0000-0000-C000-000000000046}\2.0\0]
     [HKEY_CLASSES_ROOT\TypeLib\{00020430-0000-0000-C000-000000000046}\2.0\0\win32]
     @="C:\\Windows\\SysWOW64\\stdole2.tlb"
     [HKEY_CLASSES_ROOT\TypeLib\{00020430-0000-0000-C000-000000000046}\2.0\0\win64]
     @="C:\\Windows\\system32\\stdole2.tlb"
     [HKEY_CLASSES_ROOT\TypeLib\{00020430-0000-0000-C000-000000000046}\2.0\FLAGS]
     @="0"
     [HKEY_CLASSES_ROOT\TypeLib\{00020430-0000-0000-C000-000000000046}\2.0\HELPDIR]
     @="C:\\Windows\\system32"

     There is the registry key HKEY_CLASSES_ROOT\TypeLib\{00020430-0000-0000-C000-000000000046}\2.0\0\win64,
     but there is no the registry key such as HKEY_CLASSES_ROOT\TypeLib\{00020430-0000-0000-C000-000000000046}\1.0\0\win64.


4. OTHER:

     For reference only, there is no guarantees.

     Any questions or suggestions, please e-mail to ccb2000@163.com.