Skip to content

Getting property accValue of IAccessible throws an error. #14

Description

@wawer1

Getting property accValue of IAccessible throws an error:
Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))

using System.Windows.Automation;

public object GetValue(AutomationElement element){
            object patternObj;
            if (element.TryGetCurrentPattern(LegacyIAccessiblePattern.Pattern, out patternObj))
            {
                var legacyIAccessiblePattern = (LegacyIAccessiblePattern)patternObj;
                var iAccessible = legacyIAccessiblePattern.GetIAccessible();

                if (iAccessible != null)
                {
                    result = iAccessible.accValue; // ERROR HERE
                }
            }
            return Accessible.accValue;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions