Creating an instance of the COM component fails with "Class not registered" when "Run as administrator"

When creating an instance of a COM Interop object:

var comObj = new ComComponentClass();

I get COMException:

Retrieving the COM class factory for component with CLSID 
{C343ED84-A129-11D3-B799-0060B0F159EF} failed due to the following error: 
80040154 Class not registered 
(Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

I only get this error when starting the application with Run as administrator . When I start normally, an error does not occur.

Notes:

  • The application is a 64-bit application.
  • The COM component is an inproc server in a 64-bit dll.

Any ideas on where I should start researching why this difference occurs?

What I tried:

I used Procmon to see which registry keys are checked.

  • In both cases, the corresponding dll is found by checking the key HKCU\Software\Classes\CLSID\{C343ED84-A129-11d3-B799-0060B0F159EF}\InprocServer32
  • HKCR\CLSID\{C343ED84-A129-11D3-B799-0060B0F159EF} NAME NOT FOUND. ( , regedit.exe. , .
+5
1

, . - COM- ( : HKC * U *).

, HKCR, HKCU\Software\Classes , HKLM\Software\Classes, HKCU\Software\Classes. , HKLM\Software\Classes.

. : http://msdn.microsoft.com/en-us/library/windows/desktop/ms724498(v=vs.85).aspx

, RegSvr32 HKCU\Classes. , ( , Windows 7). COM?

+4

All Articles