RegisterDependent
TheRegisterDependentmethod puts the specified destination part on the list of parts to be notified whenever the link is updated.
void RegisterDependent (in ODPart clientPart, in ODUpdateID id);
clientPart- A reference to the destination part wishing to be notified of changes to the content of the link source.
id- The update ID of the content the specified part last read from the link source.
DISCUSSION
If your part is a destination of this link, you can call this method to register your part as a dependent of this link object. Dependent parts receive automatic notification of any changes to the link's content. You can remove your part from the list of dependents by calling theUnregisterDependentmethod.You should call this method in your part's
HandleEventmethod after calling theShowLinkDestinationInfomethod if the user has requested automatic notification of updates and your part is not already a registered dependent of this link object.If the link's current update ID differs from the
idparameter, OpenDoc immediately calls the specified client part'sLinkUpdatedmethod. You should pass the constantkODUnknownUpdateas the value of theidparameter when the link is first created; doing so ensures that your part'sLinkUpdatedmethod is called.
- IMPORTANT
- You should not call this method if your part is already a registered dependent of this link object, for example, because your part contains another destination of link source corresponding to this link object.
![]()
EXCEPTIONS
kODErrBrokenLink- Internal error; the link-source object disconnected from its destinations.
kODErrCannotRegisterDependent- The link object is unable to register the specified part as a dependent at this time.
SEE ALSO
TheODUpdateIDtype (page 917).
TheODLink::GetUpdateIDmethod (page 353).
TheODLink::ShowLinkDestinationInfomethod (page 357).
TheODLink::UnregisterDependentmethod (page 361).
TheODPart::LinkUpdatedmethod (page 533).
"Selection Info" on page 252 in OpenDoc Programmer's Guide.
"Automatic and Manual Updating" on page 372 in OpenDoc Programmer's Guide.
"Creating a Link at the Destination" on page 380 in OpenDoc Programmer's Guide.