I am trying to click a button using invoke pattern.
InvokePattern ipAddMPButton = (InvokePattern)aeAddMPButton.GetCurrentPattern(InvokePattern.Pattern);
try
{
ipAddMPButton .Invoke();
}
catch (System.Runtime.InteropServices.COMException e)
{
// TODO
}
It throws COMException and I can't figure out why?
When I run this code, the button is actually pressed and the functionality works well. But then it just stops for some time, and throws this exception.
Try checking aeAddMPButton.GetAllSupportedPatterns() and then try invoking then..