Export (0) Print
Expand All

IProcessInitializer Interface

Supports methods that can be called when a COM component starts up or shuts down.

Namespace: System.EnterpriseServices
Assembly: System.EnterpriseServices (in system.enterpriseservices.dll)

[GuidAttribute(L"1113f52d-dc7f-4943-aed6-88d04027e32a")] 
[InterfaceTypeAttribute(ComInterfaceType::InterfaceIsIUnknown)] 
public interface class IProcessInitializer
/** @attribute GuidAttribute("1113f52d-dc7f-4943-aed6-88d04027e32a") */ 
/** @attribute InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown) */ 
public interface IProcessInitializer
GuidAttribute("1113f52d-dc7f-4943-aed6-88d04027e32a") 
InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown) 
public interface IProcessInitializer

Implement the IProcessInitializer interface methods on serviced components if you want to run initialization or shutdown code when a server process (Dllhost.exe) starts up or shuts down, respectively.

COM+ provides Startup and Shutdown events when Dllhost.exe starts and ends. This feature enables any COM+ components that are installed in a COM+ server application (referred to as server components hereafter) to run custom initialization and clean up code. An instance of each component that implements the IProcessInitializer interface will be created and stored for the duration of the process, and called on the interface methods during startup and shutdown. When implemented on a ServicedComponent, during registration of the component, the InitializesServerApplication parameter in the COMAdminCatalogObject within the Components collection is set to true.

Using the Startup and Shutdown events, you can initialize resources, create connections, initialize shared data, and run cleanup code. However, you must not access states that are specific to COM+ because instances of server components have not yet been created. In addition, the code in the Startup and Shutdown events should return as quickly as possible, because the system waits only 90 seconds for Dllhost.exe to prepare to accept activations after the system starts the process. If Dllhost.exe does not signal that it is ready within 90 seconds, the system ends the process; thus, all initialization processing needs to be completed within this time frame. Each server component that participates in initialization must support the IProcessInitializer interface. On DllHost.exe startup, COM+ creates all server components that requested this service, calls QueryInterface for the IProcessInitializer interface, and calls the Startup function. Similarly, when the DllHost.exe process is shut down, it calls the Shutdown function on those previously stored interface pointers.

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1

Community Additions

ADD
Show:
© 2014 Microsoft