3

我想设置 Flag很快将作为参数传递navOpenInBackgroundTabBrowserNavConstants enumIWebBrowser2::Navigate2Method

签名IWebBrowser2::Navigate2:-

HRESULT Navigate2(
    VARIANT *URL,
    VARIANT *Flags,
    VARIANT *TargetFrameName,
    VARIANT *PostData,
    VARIANT *Headers
);

这是我有问题的地方: -

VARIANT SITE={0}, vFlags = {0},vTargetFrameName = {0},vPostData = {0},vHeaders = {0};
...
...
vFlags.intVal=navOpenInBackgroundTab;//<--Here,Don't know how to do it.Not Working..

m_spWebBrowser->Navigate2(&SITE, &vFlags,&vTargetFrameName, &vPostData, &vHeaders);

非常感谢您的支持。

4

1 回答 1

0

使用InitVariantFromInt32:-

HRESULT hr = InitVariantFromInt32(navOpenInBackgroundTab, &vFlags);

您也可以使用(来自我的旧代码库:)):-

V_VT(&vFlags) = VT_I4;
V_I4(&vFlags) = navOpenInBackgroundTab; 
于 2012-09-05T18:28:04.083 回答