msxml3: Fix IXMLDOMDocument::createElement(), cast from node to element isn't possible.

This commit is contained in:
Nikolay Sivov 2010-02-12 21:48:01 +03:00 committed by Alexandre Julliard
parent 24e198e2ff
commit ce2372667e
1 changed files with 10 additions and 1 deletions

View File

@ -1039,7 +1039,9 @@ static HRESULT WINAPI domdoc_createElement(
IXMLDOMElement** element )
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
IXMLDOMNode *node;
VARIANT type;
HRESULT hr;
TRACE("(%p)->(%s,%p)\n", This, debugstr_w(tagname), element);
@ -1048,7 +1050,14 @@ static HRESULT WINAPI domdoc_createElement(
V_VT(&type) = VT_I1;
V_I1(&type) = NODE_ELEMENT;
return IXMLDOMDocument_createNode(iface, type, tagname, NULL, (IXMLDOMNode**)element);
hr = IXMLDOMDocument_createNode(iface, type, tagname, NULL, &node);
if (hr == S_OK)
{
IXMLDOMNode_QueryInterface(node, &IID_IXMLDOMElement, (void**)element);
IXMLDOMNode_Release(node);
}
return hr;
}