摘要 |
A method in a COM environment enables a first object (X) to be informed of an accidental death of one or more second objects (Y). When the first object (X) opens communications with one of the second objects (Y), the first object (X) creates an intermediate object (W) and sends a message having a reference to the intermediate object (W) to the corresponding second object. When the message has been received, the second object calls the COM "AddRef" function using the reference to the intermediate object (W) as a calling parameter. If a second object accidentally dies, COM calls the "Release" function to release the corresponding intermediate object, which sends a message (D) to the first object (X) informing the first object (X) of the accidental death of the particular second object. The first object (X) creates an intermediate object (W) for each second object (Y) so that the first object can be informed of the accidental death of each respective second object.
|