Can I avoid this Member not found. (Exception from HRESULT: 0x80020003 (DISP_E_MEMBERNOTFOUND))?

0

This System.Runtime.InteropServices.COMException comes from acquiring an instance of a (COM wrapper) UIAutomationClient.IAccessible and then calling accLocation on the object:

Interop.AccessibleObjectFromEvent( hWnd, idObject, idChild, out var accessible, out var accessibleChild );
int x = 0, y = 0, w = 0, h = 0;
accessible?.accLocation( out x, out y, out w, out h, child );

Some objects that come in on the WinEvents hook I'm listening to don't have some of the properties in the interface. I'm handling the exception...and that gets me down the road, but I would like to "discover" that the property isn't in the object rather than getting a noisy exception.

c#
interop
ui-automation
asked on Stack Overflow Oct 31, 2019 by Clay • edited Oct 31, 2019 by Clay

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0