我尝试使用 Iaccessible 接口(interface)的 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);
关于c++ - Iaccessible接口(interface)的accLoacation()方法中的参数如何初始化?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57599319/