本文整理汇总了C++中COMPtr::getElementById方法的典型用法代码示例。如果您正苦于以下问题:C++ COMPtr::getElementById方法的具体用法?C++ COMPtr::getElementById怎么用?C++ COMPtr::getElementById使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类COMPtr
的用法示例。
在下文中一共展示了COMPtr::getElementById方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: elementDoesAutoCompleteForElementWithId
bool LayoutTestController::elementDoesAutoCompleteForElementWithId(JSStringRef id)
{
COMPtr<IDOMDocument> document;
if (FAILED(frame->DOMDocument(&document)))
return false;
wstring idWstring = jsStringRefToWString(id);
BSTR idBSTR = SysAllocStringLen((OLECHAR*)idWstring.c_str(), idWstring.length());
COMPtr<IDOMElement> element;
HRESULT result = document->getElementById(idBSTR, &element);
SysFreeString(idBSTR);
if (FAILED(result))
return false;
COMPtr<IWebFramePrivate> framePrivate(Query, frame);
if (!framePrivate)
return false;
BOOL autoCompletes;
if (FAILED(framePrivate->elementDoesAutoComplete(element.get(), &autoCompletes)))
return false;
return autoCompletes;
}
示例2: sampleSVGAnimationForElementAtTime
bool LayoutTestController::sampleSVGAnimationForElementAtTime(JSStringRef animationId, double time, JSStringRef elementId)
{
COMPtr<IDOMDocument> document;
if (FAILED(frame->DOMDocument(&document)))
return false;
BSTR idBSTR = JSStringCopyBSTR(animationId);
COMPtr<IDOMElement> element;
HRESULT hr = document->getElementById(idBSTR, &element);
SysFreeString(idBSTR);
if (FAILED(hr))
return false;
COMPtr<IWebFramePrivate> framePrivate(Query, frame);
if (!framePrivate)
return false;
BSTR elementIdBSTR = JSStringCopyBSTR(elementId);
BOOL wasRunning = FALSE;
hr = framePrivate->pauseSVGAnimation(elementIdBSTR, element.get(), time, &wasRunning);
SysFreeString(elementIdBSTR);
return SUCCEEDED(hr) && wasRunning;
}
示例3: pauseTransitionAtTimeOnElementWithId
bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId)
{
COMPtr<IDOMDocument> document;
if (FAILED(frame->DOMDocument(&document)))
return false;
BSTR idBSTR = JSStringCopyBSTR(elementId);
COMPtr<IDOMElement> element;
HRESULT hr = document->getElementById(idBSTR, &element);
SysFreeString(idBSTR);
if (FAILED(hr))
return false;
COMPtr<IWebFramePrivate> framePrivate(Query, frame);
if (!framePrivate)
return false;
BSTR nameBSTR = JSStringCopyBSTR(propertyName);
BOOL wasRunning = FALSE;
hr = framePrivate->pauseTransition(nameBSTR, element.get(), time, &wasRunning);
SysFreeString(nameBSTR);
return SUCCEEDED(hr) && wasRunning;
}