ITrackSelection::OnSelectChange

Specifies the selection container interface to call for the current object.

HRESULT OnSelectChange(
   ISelectionContainer *pSC
);

Parameter

pSC

[in] Pointer to an object of type ISelectionContainer.

Return Values

The return value obtained from HRESULT is one of the following:

Return Value Meaning
S_OK Success.
E_INVALIDARG The argument is invalid.

Comments

The host implements OnSelectChange.

The ActiveX designer calls OnSelectChange, passing a pointer to its implementation of the ISelectionContainer interface. As the user browses and edits the objects, the host calls the methods supported by ISelectionContainer to manage the selection.

Through the CountObjects, GetObjects, and SelectObjects methods, the selection container enables enumeration and selection of one or more objects. When the designer is destroyed, the host calls the designer's IOleObject::SetClientSite(NULL) method. In response, the designer should call ITrackSelection::OnSelectChange(NULL) to ensure that the host releases the designer's ISelectionContainer object.

Example

The following example calls OnSelectChange to pass a pointer to pISC, a selection container interface. The host can call CountObjects, GetObjects, and SelectObjects through this pointer.

hr =  m_state.pServiceProvider->QueryService(SID_STrackSelection, 
                   IID_ITrackSelection,
                   (void **) &pITS);
hr = pITS->OnSelectChange(pISC);
pITS->Release();