Microsoft KB Archive/239879

= CoCreateInstance Fails on COM+ Object with Object Construction Enabled and No Constructor String Present =

Article ID: 239879

Article Last Modified on 2/28/2007

-

APPLIES TO


 * Microsoft Windows 2000 Server
 * Microsoft Windows 2000 Advanced Server
 * Microsoft Windows 2000 Professional Edition

-



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.



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.

Additional query words: objectconstruct, complus, win2k, win2000

Keywords: kbprb kbsysadmin KB239879

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.