Home > Blockchain >  How to Resolve IAccessible Type Not Defined Error
How to Resolve IAccessible Type Not Defined Error

Time:01-09

I am new to Visual Studio (currently using a Visual Basic Forms starter application) and have been experiencing the issue addressed in IAccessible type not defined visual basic

Here I am attempting to import the AccessibleObjectFromWindow function via a Declare statement within my code, as such:

Private Declare Function AccessibleObjectFromWindow Lib "oleacc.dll" (ByVal hWnd As Long, ByVal dwId As Long, ByRef riid As Guid, ByRef ppvObject As IAccessible) As Long
Dim obj As IAccessible
'Save the IAccessible interface pointer onto obj
Call AccessibleObjectFromWindow({WINDOW_HANDLE}, 0, guid, obj)

However, the IAccessible type is not available within my project and the solution to import the olacc.dll library located in the System32 folder described in the previous post (linked above) yielded a warning messagebox claiming "The reference is invalid or unsupported".

Is there any way I can import the IAccessible Type, or bypass the issue altogether and interact with the ppvObject I will using an ambigious type (ie Object/Variant)? What is the best approach to addressing this issue?

CodePudding user response:

Have you tried Imports Accessibility?

IAccessible is in Accessibility Namespace

  • Related