cookey
asked on
Some problem with AccessibleChildren function declare
I want to find a DirectUIhwnd's child control,so I implement the following code:
function AccessibleObjectFromWindow (Ahwnd: HWND; dwObjectID: DWORD; const riid: TGUID; out ppvObject ): HResult; stdcall; external 'OLEACC.DLL' name 'AccessibleObjectFromWindo w';
function AccessibleChildren( paccContainer: IAccessible; iChildStart: LONGINT; cChildren: LONGINT; out rgvarChildren: PVarArray; out pcObtained: LONGINT ): HRESULT;stdcall; external 'OLEACC.DLL' name 'AccessibleChildren';
////////////////////////// ////////// ////////// ////////// //////////
var
x,i:integer;
pa:PVarArray;
blub: IAccessible;
l:longint;
begin
....
....
if AccessibleObjectFromWindow (FirstDlgH d, 0, IID_IAccessible, blub) = S_OK then
begin
x := blub.Get_accChildCount;
AccessibleChildren(blub, 0, x, pa, L); // this token has problem, the "pa" paramitere result is $9,and the length of "pa" is zero,
pa[0].Get_accName(0);//thi s token will raise an error, pa[0] is nil;
end;
Wether the declare of "AccessibleChildren" is wrong or I use "PVarArray" wrongly or improperly ?
function AccessibleObjectFromWindow
function AccessibleChildren( paccContainer: IAccessible; iChildStart: LONGINT; cChildren: LONGINT; out rgvarChildren: PVarArray; out pcObtained: LONGINT ): HRESULT;stdcall; external 'OLEACC.DLL' name 'AccessibleChildren';
//////////////////////////
var
x,i:integer;
pa:PVarArray;
blub: IAccessible;
l:longint;
begin
....
....
if AccessibleObjectFromWindow
begin
x := blub.Get_accChildCount;
AccessibleChildren(blub, 0, x, pa, L); // this token has problem, the "pa" paramitere result is $9,and the length of "pa" is zero,
pa[0].Get_accName(0);//thi
end;
Wether the declare of "AccessibleChildren" is wrong or I use "PVarArray" wrongly or improperly ?
how are you initialize pa variable?
And that is GetLastError after run AccessibleChildren function?
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Forced accept.
Computer101
EE Admin
Computer101
EE Admin
ASKER