Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/140.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 如何在C++;_C++_Google Chrome_Url_Hwnd_Iaccessible - Fatal编程技术网

C++ 如何在C++;

C++ 如何在C++;,c++,google-chrome,url,hwnd,iaccessible,C++,Google Chrome,Url,Hwnd,Iaccessible,我想使用MSAA API从Google Chrome获取URL,我已经在StackOverflow上找到了,但我想复制此行为=>,不使用AccessibleObjectFromEvent,而是使用AccessibleObjectFromWindow。 但在这几行之后: HRESULT hr = AccessibleObjectFromWindow(hwnd_addr_bar, OBJID_CLIENT, IID_IAccessible, (void **)&ac);

我想使用MSAA API从Google Chrome获取URL,我已经在StackOverflow上找到了,但我想复制此行为=>,不使用AccessibleObjectFromEvent,而是使用AccessibleObjectFromWindow。 但在这几行之后:

    HRESULT hr = AccessibleObjectFromWindow(hwnd_addr_bar, OBJID_CLIENT, IID_IAccessible, (void **)&ac);



    if ((hr == S_OK ) && (ac!=NULL)){
        tagVARIANT state;
        VariantInit(&state);
        BSTR szAddressBox = NULL;
        HRESULT hr1 = ac->get_accValue(varchild, &szAddressBox);

    }
szAddressBox是空的。我错在哪里