I am trying to develop the ScreenReader in C#, I need to use IAccessibility to access the system events. Before that I should require to get the IAccesibility object using AccessibleObjectFromEvent. The signature and the defination shown below.
Signature:
Expand|Select|Wrap|Line Numbers
- [DllImport("oleacc.dll")]
- public static extern uint AccessibleObjectFromEvent(IntPtr hwnd, long dwObjectID, long dwChildID, out IAccessible iAccessible, out object pvarChild);
Expand|Select|Wrap|Line Numbers
- Accessibility.IAccessible iAccessible = null; //AccessibilityObject;
- object obj = null;
- long hr = oleacc.AccessibleObjectFromEvent(hwndMsg, idObject, idChild, out iAccessible, out obj);
PInvokeStackImbalance was detected
Message: A call to PInvoke function 'Ravi project!Ravi_project.winevent+oleacc::AccessibleOb jectFromEvent' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.
Please help me in above problem.