Any recipe would be very much appreciated. The msdn XML & C++ samples are
not very helpful, since they don't compile.
Thanks
Jens
Jens L <lipp...@micromodeling.com> wrote in message
news:e5udL4Dj#GA.266@cppssbbsa03...
Jens
bob thickens <bo...@electroniclaim.com> wrote in message
news:eAxed9Gj#GA....@cppssbbsa02.microsoft.com...
Here is a short sample using #import that should save the following XML
stream in the test.xml file : <document><tag name="value"/></document>
And now the magic :
#import "msxml.dll"
int main(int argc, char* argv[])
{
CoInitialize(0);
MSXML::IXMLDOMDocumentPtr pDoc;
HRESULT hr = pDoc.CreateInstance(__uuidof(MSXML::DOMDocument));
MSXML::IXMLDOMElementPtr pElement = pDoc->createElement("document");
pDoc->appendChild(pElement);
pElement = pDoc->createElement("tag");
_variant_t value("value");
pElement->setAttribute("name",&value);
pDoc->documentElement->appendChild(pElement);
_variant_t dest("c:\\test.xml");
pDoc->save(&dest);
pElement.Release();
pDoc.Release();
CoUninitialize();
return 0;
}
Hope this helps
Christian
Al.
Jens L <lipp...@micromodeling.com> wrote in message
news:#yKmYzLj#GA.263@cppssbbsa03...
> The only C++ sample there does not compile. Seems like C++ does not get a
> whole lot of attention in the sitebuilder area of msdn.
> Did anyone tried to use the DOM (msxml 2.0) from VC?
>
> Jens
>
>
> bob thickens <bo...@electroniclaim.com> wrote in message
> news:eAxed9Gj#GA....@cppssbbsa02.microsoft.com...
> >
>
see:http://msdn.microsoft.com/workshop/xml/xmldom/scriptref/xmldom_objects.a
> > sp
> > it has some sample code
> >
> > Jens L <lipp...@micromodeling.com> wrote in message