Freigeben über


IMsoComponentManager::OnComponentEnterState Method

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Notifies the component manager that the specified component is entering the state identified by the uStateID parameter.

void OnComponentEnterState(
   DWORD_PTR dwComponentID,
   ULONG uStateID,
   ULONG uContext,
   ULONG cpicmExclude,
   IMsoComponentManager **rgpicmExclude,
   DWORD dwReserved
);

Parameters

  • dwComponentID [in]
    The ID of the component that is entering the state.

  • uStateID [in]
    One of the Msocstate enumeration values.

  • uContext [in]
    The state context that is affected by the state change. The component manager informs only the components and hosts that are within the specified state context. The values specified in the following table can be used.

    Value

    Description

    msoccontextAll = 0

    Specifies all state contexts in the state context tree.

    msoccontextMine = 1

    Specifies the component manager's state context.

    msoccontextOthers = 2

    Specifies all state contexts outside of the component manager’s state context.

  • cpicmExclude [in]
    The number of entries in the rgpicmExclude parameter.

  • rgpicmExclude [in, optional]
    An array that contains the number of pointers to component managers as specified by the cpicmExclude parameter. Components within the state context of a component manager that exists in this array should not be notified of the state change. The rgpicmExclude parameter can be NULL.

  • dwReserved [in]
    Reserved for future use; should be 0.

Remarks

Calls to this method are symmetric with calls to the IMsoComponentManager::FOnComponentExitState method. That is, if n OnComponentEnterState method calls are made, the component is considered to be in the state until n FOnComponentExitState calls are made. Before revoking its registration, a component must make a sufficient number of FOnComponentExitState calls to offset any outstanding OnComponentEnterState calls it has made.

In-place objects should not call this method with the uStateID parameter equal to msocstateModal when entering the modal state. Such objects should call the IOleInPlaceFrame::EnableModeless method instead.

The component manager should notify all other components within the state context indicated by the uContext parameter, excluding those within the state context of a component manager in the rgpicmExclude parameter, by calling the IMsoComponent::OnEnterState method.

See Also

Reference

IMsoComponentManager Interface