- // Use standard interface instead.
- IAccessible* stdInterface = (IAccessible*)m_pAccessible->GetIAccessibleStd();
- if (!stdInterface)
- return E_FAIL;
- else
- return stdInterface->accLocation(pxLeft, pyTop, pcxWidth, pcyHeight, varID);
+ // Try to use child object directly.
+ if (varID.lVal > 0)
+ {
+ IAccessible* childAccessible = GetChildAccessible(varID.lVal);
+ if (childAccessible)
+ {
+ varID.lVal = 0;
+ HRESULT hResult = childAccessible->accLocation(pxLeft, pyTop, pcxWidth, pcyHeight, varID);
+ childAccessible->Release();
+ return hResult;
+ }
+ else if (m_pAccessible->GetIAccessibleStd())
+ return ((IAccessible*) m_pAccessible->GetIAccessibleStd())->accLocation(pxLeft, pyTop, pcxWidth, pcyHeight, varID);
+ }
+ else if (m_pAccessible->GetIAccessibleStd())
+ return ((IAccessible*) m_pAccessible->GetIAccessibleStd())->accLocation(pxLeft, pyTop, pcxWidth, pcyHeight, varID);