Partilhar via


OLEROLE Enum

Definition

Specifies the way in which a component is being used in relation to its host.

public enum class OLEROLE
public enum class OLEROLE
enum OLEROLE
public enum OLEROLE
type OLEROLE = 
Public Enum OLEROLE
Inheritance
OLEROLE

Fields

Name Value Description
OLEROLE_UNKNOWN -1

Role is undefined.

OLEROLE_COMPONENTHOST 0

Indicates that the component is the outermost frame; it is used at the environment level.

OLEROLE_HOSTEXTENSION 0

Indicates that the component is being used at the same level as the environment.

OLEROLE_TOPLEVELCOMPONENT 0

Indicates that the component is an independent floating modeless component with no in-place capabilities. Top-level components need to coordinate modality and message loop services with the environment through the SOleComponentManager service.

OLEROLE_MAINCOMPONENT 1

Indicates that the component has compile time knowledge of a nested object that it will be hosting in place. A main component has its user interface elements built into the environment and controls the menu commands available for it and for all of its nested subcomponents. This is also known as a hardwired component.

OLEROLE_SUBCOMPONENT 2

Indicates that the component has compile time knowledge of a nested object that it contains in place like a main component, but it is not ultimately in control of its user interface modes. However, a subcomponent is included in the container command routing chain and can thereby handle commands when a nested object becomes visible and takes focus.

OLEROLE_COMPONENTCONTROL 3

Indicates that the component does not contain nested in-place objects and is not included in the container command routing chain. Therefore, component controls can only handle commands when they are in the UI active state. OLEROLE_COMPONENTCONTROL is the default role for a component; all components should assume they are being used as component controls unless told otherwise. Component controls do not implement IOleInPlaceComponent. They must return the IOleComponentUIManager interface pointer by calling their site's IServiceProvider interface.

Remarks

The role of a component is important in many ways. Some components will only function properly if they are used in the role of a main component. These components can fail the IOleInPlaceComponent::UseComponentUIManager call. Other components display a different context menu depending on which role they are taking on. For example, in the design mode of Microsoft Access, the right click menu for a control in a sub-form is different than that for a control in a main form.

When a component takes focus by calling IOleComponentUIManager::UIActivateForMe, it passes its role as a parameter in the call. This role information is used by the environment when its main component is the UI active component. The component can pass a set of flags back to the environment that controls aspects of the component in the environment.

COM Signature

From oleipc.idl.

[C++]

Applies to