PRB: Error "COM+ Internal Runtime Error 0x80041011" (298365)



The information in this article applies to:

  • Microsoft COM+ 1.0
  • Microsoft COM+ 1.5

This article was previously published under Q298365

SYMPTOMS

When you write a component that manipulates the COM+ catalog through the COM+ Admin objects, if you call this component from Active Server Pages (ASP) on Microsoft Windows 2000 and Microsoft Windows XP, you may receive the following error message:
COM+ internal runtime error 0x80041011

CAUSE

The component that you are trying to install is already configured in a COM+ application.

RESOLUTION

To resolve this problem, add code to the method that installs the new component to detect if that component is already configured. For example, the following Microsoft Visual Basic code determines whether a component in a given dynamic-link library (DLL) is already configured in COM+:
Private Function IsComponentInstalled(AppName as String, DllPath as String) As Boolean
    Dim comCat As COMAdmin.COMAdminCatalog
    Set comCat = New COMAdmin.COMAdminCatalog
    IsComponentInstalled = False
    
    ' Get the Applications collection from the COM+ catalog.
    Dim comApps As COMAdmin.COMAdminCatalogCollection
    Dim App As COMAdminCatalogObject
    Set comApps = cat.GetCollection("Applications")
    comApps.Populate
    
    Dim comComps As COMAdminCatalogCollection
    Dim comp As COMAdminCatalogObject
    
    ' Get the specific application that you are interested in.
    For Each app In comApps
        If app.Name = AppName Then
            Exit For
        End If
    Next app
    
    ' Get the Components collection from that application.
    Set comComps = apps.GetCollection("Components", app.Key)
    comComps.Populate

    ' Determine if any component in the collection belongs to the DLL in question.
    For Each comp In comComps
      If comp.Value("DLL") = DllPath Then
        IsComponentInstalled = True
        Exit For
      End If
    Next comp
End Function
				

Modification Type:MajorLast Reviewed:2/20/2002
Keywords:kbDSupport kbprb kbSysAdmin KB298365