IAccessible::get_accRole

[This is preliminary documentation and subject to change.]

Retrieves the object's Role property.

HRESULT get_accRole(
  VARIANT varChild,
  VARIANT *pvarRole
);
 

Parameters

varChild
[in] VARIANT structure that identifies the child whose role will be retrieved. This parameter can be the child ID value (provided by the object), CHILDID_SELF for the object itself, or a string identifying the child (such as "A1"). The caller must initialize the structure's vt member to indicate which union member is valid prior to the call.
pvarRole
[out, retval] Address of a VARIANT structure that will contain a role constant or a string describing the object's role. If the vt member is VT_I4 , then the lVal member contains the standard role constant. If vt is VT_BSTR, then the bstrVal member contains the description string.

Return Values

Returns S_OK if successful or E_INVALIDARG or another standard COM error code otherwise.

Note to implementers This method must not fail if no role text exists. Instead, return S_OK and set the vt member of the VARIANT structure at pvarRole to VT_EMPTY. All objects should have a role and role text.

Remarks

Do not localize the string returned from this property.

See Also

VARIANT Structure