I have a CWnd
-derived class named button, and want to use CWnd
accessibility functions, I override this function in my class:
virtual HRESULT get_accName(VARIANT varChild, BSTR *pszName);
virtual HRESULT get_accChildCount(long *pcountChildren);
virtual HRESULT get_accDefaultAction(VARIANT varChild, BSTR *pszDefaultAction);
virtual HRESULT get_accDescription(VARIANT varChild, BSTR *pszDescription);
virtual HRESULT get_accKeyboardShortcut(VARIANT varChild, BSTR *pszKeyboardShortcut);
virtual HRESULT get_accParent(IDispatch **ppdispParent);
virtual HRESULT get_accRole(VARIANT varChild, VARIANT *pvarRole);
virtual HRESULT get_accState(VARIANT varChild, VARIANT *pvarState);
virtual HRESULT get_accValue(VARIANT varChild, BSTR *pszValue);
When I run the program, and set break a point in implementation of any of these functions, program does not enter these functions, and instead uses parent function, can any help me?
implementation of get_accName:
HRESULT Button::get_accName(VARIANT varChild, BSTR *pszName)
{
//*pszName = SysAllocString(lpstrTitle);
return S_OK;
}
I call EnableActiveAccessibility()
in constructor of this class, but does not work yet.
get_accValue
? – Slaw