Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - IXMLDOMNodeListPtr (Visual C++ 6.0) >Thread Next - Re: IXMLDOMNodeListPtr (Visual C++ 6.0) Re: IXMLDOMNodeListPtr (Visual C++ 6.0)To: NULL Date: 7/5/2005 3:48:00 PM
"Petar Popara" <my.fake@m...> wrote in message
news:upRHjWUgFHA.3788@T......
>
> Can I create object of IXMLDOMNodeListPtr type? I'd like to create it and
> populate it and return it as function return value.
>
> Please could you show me how (just few lines of code) I can create object
of
> IXMLDOMNodeListPtr type and insert some nodes in the list?
>
> Thank you in advance.
>
>
An Interface cannot be directory instantiated.
Hope this code helps. MSDN has a lot of samples on using MSXML Interfaces in
both VB and C++
IXMLDOMDocument *pXMLDom=NULL;
IXMLDOMNodeList *pNodes=NULL;
BSTR bstr = NULL;
VARIANT_BOOL status;
HRESULT hr;
CoInitialize(NULL)
hr= CoCreateInstance(__uuidof(DOMDocument30),
NULL,
CLSCTX_INPROC_SERVER,
__uuidof(IXMLDOMDocument),
(void**)&pxmldoc);
pXMLDom->load("stocks.xml", &status));
if (status!=VARIANT_TRUE) {
//Failed to load DOM from stocks.xml");
}
// Query a node-set.
if (bstr) SysFreeString(bstr);
bstr = SysAllocString(L"//stock[1]/*");
pXMLDom->selectNodes(bstr, &pNodes);
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
