I am attaching my ActiveSelectionObserver on a document on kAfterOpenDocSignalResponderService by pasing the docRef.
Please see below code:
case kAfterOpenDocSignalResponderService: { InterfacePtr<IDocumentSignalData> documentSignalData(signalMgr, UseDefaultIID()); UIDRef docUIDRef = documentSignalData->GetDocument(); /*ActiveSelectionObserver: this will observe all the selection changes in the document pageItems selected, text selected, deselected etc.*/ InterfacePtr<IObserver> selDocObserver(docUIDRef, IID_ICSDTSELECTIONOBSERVER); if (selDocObserver != nil) { selDocObserver->AutoAttach(); } break; }
The observer is supposed to get attached on the event of opening a existing Doc, but once the observer is attached on the document then when I create a new doc, the observer gets attached on that
doc as well which want to restrict. I just want my Observer to respond only to the doc which I used to reference the Observer.
What shall I do?