CoCreateInstance Fails on COM+ Object with Object Construction Enabled and No Constructor String Present (239879)



The information in this article applies to:

  • Microsoft Windows 2000 Server
  • Microsoft Windows 2000 Advanced Server
  • Microsoft Windows 2000 Professional

This article was previously published under Q239879

SYMPTOMS

Create a component that implements IObjectConstruct::Construct. Configure the component as a COM+ application and enable the object construction property, but do not provide a constructor string.

Attempting to instantiate the COM+ object results in the following error:
Error 8004e025 Automation Error
COM+ Activation function failed because an initialization function failed.

WORKAROUND

The workaround for this problem is to enter a dummy string or just spaces in the Constructor String field.

MORE INFORMATION

Steps to Reproduce Behavior:

  • Create a component that derives from IObjectConstruct and implements IObjectConstruct::Construct but does not use a constructor string.
  • Configure this component in a COM+ Server Application such that object construction is enabled in Component Services but the constructor string is left blank.
To do this:
  1. On the Start menu, select Programs, and then select Administrative Tools to launch Component Services.
  2. Create a new COM+ Server Application under My Computer\COM+ Applications.
  3. Install your component in this Application.
  4. Right-click on this configured component and select Properties. Click the Activation tab.
  5. Select the Enable Object Construction button and leave the Constructor String blank.
  6. Try to create this component through a client application.
An error message is displayed saying:
Error 8004e025 Automation Error
COM+ Activation function failed because an initialization function failed.
If you just enter a dummy string or spaces for the constructor string, an instance of the object can be created.

Modification Type:MajorLast Reviewed:11/20/2003
Keywords:kbprb kbSysAdmin KB239879