如何在 Iaccessible 接口的 accLoacation() 方法中启动参数?

How to initiate the parameters in accLoacation() method of Iaccessible interface?

本文关键字:方法 启动 参数 accLoacation Iaccessible 接口      更新时间:2023-10-16

>我尝试使用Iaccess接口的accLocation((方法检索元素的屏幕位置,但无法启动该方法的参数

IAccessible *plocation;
long *x;
long *y;
long *width;
long *height;
VARIANT varChild;
varChild.vt = VT_I4;
varChild.iVal = CHILDID_SELF;
hr = pIaccessible->GetIAccessible(&plocation);
hr = plocation->accLocation(x, y, width, height, varChild);

但是当我运行它时,错误消息如下:

uninitialized local variable 'x'used,
uninitialized local variable 'y'used,
uninitialized local variable 'width'used,
uninitialized local variable 'height'used

我有一种感觉,你需要使用:

long x;
long y;
long width;
long height;
...
// Pass the addresses of objects where the values can be stored.
hr = plocation->accLocation(&x, &y, &width, &height, varChild);