Called by the framework to retrieve information that describes the role of the specified object.

virtual HRESULT get_accRole( 
   VARIANT varChild, 
   VARIANT *pvarRole 


Specifies whether the role information to be retrieved is that of the object or one of the object's child elements. This parameter can be either CHILDID_SELF (to obtain information about the object) or a child ID (to obtain information about the object's child element).


Receives the role information. See pvarRole in IAccessible::get_accRole in the Windows SDK.

Returns S_OK on success, a COM error code on failure. See Return Values in IAccessible::get_accRole in the Windows SDK.

This function is part of MFC's Active Accessibility support.

Override this function in your CWnd-derived class if you have nonwindowed user interface elements (other than windowless ActiveX controls, which MFC handles).

For more information, see IAccessible::get_accRole in the Windows SDK.

Header: afxwin.h