Any idea how to get this API to work?

C

codercode

Private Declare Function AccessibleChildren Lib "oleacc" (ByVal
paccContainer As IAccessible, _
ByVal iChildStart As Integer, _
ByVal cChildren As Integer, _
ByVal rgvarChildren() As Object, _
ByVal pcObtained As Integer) As UInteger

Dim iTMP As Accessibility.IAccessible
Dim lngTMP2 As Integer
iTMP = lngTMP
Dim lngCount As Integer
lngCount = iTMP.accChildCount
Dim Children(lngCount - 1) As Object

Call AccessibleChildren(iTMP, 0, (lngCount - 1), Children(0), lngTMP2)

I can't get the 'rgvarChildren' parameter correct.

My code's translated from the following C# code:

[DllImport("Oleacc.dll")]
public static extern int AccessibleChildren(
Accessibility.IAccessible paccContainer,
int iChildStart,
int cChildren,
[Out] object[] rgvarChildren,
out int pcObtained);

int _ChildCount = IACurrent.accChildCount;
object[] _Children = new object[_ChildCount];
int _out;

AccessibleChildren(IACurrent,0,_ChildCount-1,_Children,out _out);

It doesn't work on VB 2005. An empty Children is returned.
However, it does work on VB6 by declaring Children as a Variant. Any
ideas?

Thanks in advance
 
?

=?ISO-8859-1?Q?Erik_Wikstr=F6m?=

Private Declare Function AccessibleChildren Lib "oleacc" (ByVal
paccContainer As IAccessible, _
ByVal iChildStart As Integer, _
ByVal cChildren As Integer, _
ByVal rgvarChildren() As Object, _
ByVal pcObtained As Integer) As UInteger

Dim iTMP As Accessibility.IAccessible
Dim lngTMP2 As Integer
iTMP = lngTMP
Dim lngCount As Integer
lngCount = iTMP.accChildCount
Dim Children(lngCount - 1) As Object

Call AccessibleChildren(iTMP, 0, (lngCount - 1), Children(0), lngTMP2)

I can't get the 'rgvarChildren' parameter correct.

My code's translated from the following C# code:

[DllImport("Oleacc.dll")]
public static extern int AccessibleChildren(
Accessibility.IAccessible paccContainer,
int iChildStart,
int cChildren,
[Out] object[] rgvarChildren,
out int pcObtained);

int _ChildCount = IACurrent.accChildCount;
object[] _Children = new object[_ChildCount];
int _out;

AccessibleChildren(IACurrent,0,_ChildCount-1,_Children,out _out);

It doesn't work on VB 2005. An empty Children is returned.
However, it does work on VB6 by declaring Children as a Variant. Any
ideas?

I will just assume that you posted this to the wrong group.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,522
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top