Ошибка failed to create com instance

Behavior:
Sometimes you start the DocuWare Client and you receive the error message «Failed to create COM instance ……»

Solution:
The Windows user has not enough rights to access the DocuWare Registry Keys!

  1. Copy the dwreg2.exe from the Setuppath from the Server to the desktop of the problem workstation or search for the dwreg2.exe in the current DocuWare Client installation folder.
  2. Start the Tool (with Administrator rights) and clean at first the DocuWare Client Registry Key:

     
  3. Then clean the DocuWare Setup Registry Key:

     
  4. Now clean the DocuWare Client for HKCU:
  5. Then repeat the step with «DocuWare Setup» to clean the DocuWare Setup for HKCU.
  6. After all this steps, please select or enter the DocuWare Client Path and use the Button «Registry assemblies»:

Now you can start the DocuWare Client without problem again!

This article is valid for DocuWare versions: 5.1b 5.1c 6.0 6.1 6.5 6.6 6.7 | com instance windows client installation #FAQID_2401

I am getting below error when try to create com object in .net for user without admin rights.

The COM class factory for component with CLSID {6CA9DEBE-BA91-4E56-9CD3-D40FE0755204} failed due to the following error Unable to retrieve: 800704ec This program is blocked by group policy. Apply to get your system administrator for more information. (Exception from HRESULT: 0x800704EC).

Code is as shown below:

dynamic obj=null;
try
{
try
{
var ComType = Type.GetTypeFromProgID(«XenReports.XenReportsX»);
obj = Activator.CreateInstance(ComType);
}
catch(Exception)
{
throw new Exception(TextMessageProvider.GetText(ResourceKeys.XenReportErrorMessage));
}

Please let me know if any one has faced this problem.
Com object is for C++ exe.

asked Mar 5, 2015 at 6:23

krishan aggarwal's user avatar

the problem as the error says itself, is your group policy settings. The user with which you are trying to create the COM object, does not have enough privileges under the current group policy,to do any such creation.

You can add this user to the ‘admin’ group on this machine and then try.

in case you are trying to access the object over network, then you also need to do the appropriate DCOM settings. Run ‘dcomcnfg’ then Component services->MyComputer ->DCOM Config. Now select the component and right click to change its properties like ‘Launch and Activation Permissions’ and which user is allowed to launch it etc.

answered Mar 5, 2015 at 7:03

dorKKnight's user avatar

1

Многие из функций COM имеют этот тип возврата, который представляет из себя 32 битное число. Именно эта величина и является одним из методов возвращения ошибки. Биты этой величины содержат информацию:

31    - наличие ошибки ( 0 нет 1 есть)
30-27 - резерв
26-16 - область ошибки
15    - 0 код ошибки

Вобщем для начала нам нужно проверить этот бит на наличие флага ошибки. Есть два макроса, которые позволяют нам проверить этот бит.

#define FAILED(Status) ((HRESULT)(Status)<0)
#define SUCCEEDED(Status) ((HRESULT)(Status) >= 0)

Пример применения макроса FAILED:

if ( FAILED( hr )) 
{ 
	cout << "Failed to create server instance " << endl;
	return;
}

Получив ошибку нам бы лучше всего ее расшифровать. Для этого есть специальная утилита в VC в меню TOOLS:

44_1.gif (2492 b)

После ее запуска появится диалоговое окно, в которое можно ввести ошибку и посмотреть, что она обозначает.

44_2.gif (2339 b)

Увидев русские буквы я немного опешил. VC вроде нормальный. А чего это пишет не так ? Подумав я решил может и не правильно, но более менее разумно. Основу этой функции составляет функция Win 32 API — FormatMessage(), которая может вернуть информацию об ошибке. Windows у меня русский. Поискав на диске эту фразу я ее нашел. Она в Kernel32.dll.

44_3.gif (7448 b)

  • Remove From My Forums
  • Question

  • I’m trying to create an instance of the ISpVoice interface. When I use the sample provided with the SAPI SDK it works fine but in my code, I cannot create an instance. The HRESULT returned is 0x80040154, class not registered and GetLastError() states invalid access to memory. The code where I am trying to create an insance is in a DLL that I’ve created and is being called from a console app. What could I be missing?

    The offending code is as follows:

      hr = CoInitializeEx( NULL, COINIT_MULTITHREADED | COINIT_SPEED_OVER_MEMORY );

      hr = m_cpVoice.CoCreateInstance( CLSID_SpVoice );

      if( FAILED( hr ) )
      {
       dwError = GetLastError();
       if( ! dwError )
        dwError = HRESULT_CODE( hr );

       lstrcpy( szBuf, «System error 0x» );
       ltoa( dwError, szBuf + lstrlen( szBuf ), 16 );
       lstrcat( szBuf, » » );

       FormatMessage( FORMAT_MESSAGE_FROM_SYSTEM, 0x00, dwError, 0x00, szBuf + lstrlen( szBuf ), sizeof( szBuf ) — lstrlen( szBuf ), 0x00 );
       printf( szBuf );
      }

Answers

  • Gotcha.  Well, since it’s your own component, then I’m still suspecting registration issues that you might be missing.  I would try the SAPI newsgroup (above), since they’ll at least be familiar with the domain you’re working in.

System administrators use IIS Manager to manage the applications they host in web servers. If IIS Manager doesn’t open because of an error such as “Creating an instance of the COM component with CLSID failed (800700b7)”, it may cause delays in maintenance and migrations.

The error message:

There was an error when trying to connect. Do you want to retype your credentials and try again?

Details:
Creating an instance of the COM component with CLSID from the IClassFactory failed due to the following error: 800700b7. Cannot create a file when that file already exists. (Exception from HRESULT: 0x800700B7).

Error "Creating an instance of the COM component with CLSID failed (800700b7)"

This issue occurs when there is a missing, corrupt or duplicate library that prevents IIS Admin Service from running. It may happen after an in-place upgrade, migration, Windows updates or any other operation that works with system libraries.

There are a couple things to check if you run into this issue:

  • Have a look at Application and System sections in Event Viewer to find out information about the root cause
  • Collect a trace by using Process Monitor and look for any failures. It’s possible that the root cause hides behind a SUCCESS message so don’t be surprised if everything looks good in the trace (Example). Take another trace from a working server and compare them

If you can’t find out the root cause from logs and traces, here are a few things to try for solving this issue (Check if IIS Manager opens successfully after each step):

  1. Uninstall and install IIS Management Tools
  2. Try to start IIS Admin Service in Services window
  3. Run iisreset in admin Command Prompt
  4. Run aspnet_regiis -I in admin Command Prompt
  5. Reinstall .NET Framework version you have
  6. Check the permissions on this folder: c:programDataMicrosoftcryptoRSAmachineKeys
    Make sure Everyone has Read/Write and Administrators have all permissions (A related forum post)
  7. Restore IIS config files from backup (Config files are in this folder: C:WindowsSystem32inetsrvconfig)
  8. If nothing works, uninstall and install IIS back (Similar issue)

If the error message mentions a problem with local activation, check this post out for the troubleshooting steps: DCOM 10016 Local Activation permission for the COM Server

Понравилась статья? Поделить с друзьями:
  • Ошибка failed to connect to the server
  • Ошибка f46f kyocera как устранить
  • Ошибка f44 на табло газовый счетчик галлус
  • Ошибка f43 стиральная машина сименс как исправить ошибку
  • Ошибка f43 стиральная машина бош logixx