Performs initialization or cleanup when entering or exiting a COM apartment.
When To Implement
Implement this interface when you want to define code to be called whenever CoInitializeEx (or CoInitialize) or CoUninitialize is called.
When To Use
Use this interface when you need to do initialization or cleanup when entering or exiting a COM apartment.
Use CoRegisterInitializeSpy to register the particular implementation of the IInitializeSpy interface to be used.
Methods
The IInitializeSpy interface inherits the methods of the IUnknown interface.
In addition, IInitializeSpy defines the following methods.
| Method | Description |
PreInitialize |
Performs initialization steps required before calling the CoInitializeEx function.
|
PostInitialize |
Performs initialization steps required after calling the CoInitializeEx function.
|
PreUninitialize |
Performs cleanup steps required before calling the CoUninitialize function.
|
PostUninitialize |
Performs cleanup steps required after calling the CoUninitialize function.
|
Requirements
| Minimum supported client | Windows XP with SP1 |
| Minimum supported server | Windows Server 2003 |
| Header | ObjIdl.h |
| IDL | ObjIdl.idl |
| IID | IID_IInitializeSpy is defined as 00000034-0000-0000-C000-000000000046 |
See Also
- CoRegisterInitializeSpy
Send comments about this topic to Microsoft
Build date: 7/9/2009