Problem with createElement/createNode of IXMLDOMDocumentPtr
-
Hi, I'm using MSXML to produce a XML Doc from a Tree Control in my VC++ program. I am getting an weird error while trying to create XMLNodes. IXMLDOMNodePtr DOMNodePtr[100]; DOMNodePtr[i]=ptrDocIP->createElement(strRoot.AllocSysString()); //ptrDocIP is of type IXMLDOMDocumentPtr and sysRoot is CString I'm using the above statement in a fuction and I call that fuction repeatedly to add new nodes. When I add the first nodes, I don't get any exception, but, second time I get an Exception and the program terminated. I tried with createNode function and got the same error. Can anybody help? Binayak Bhattacharyya
-
Hi, I'm using MSXML to produce a XML Doc from a Tree Control in my VC++ program. I am getting an weird error while trying to create XMLNodes. IXMLDOMNodePtr DOMNodePtr[100]; DOMNodePtr[i]=ptrDocIP->createElement(strRoot.AllocSysString()); //ptrDocIP is of type IXMLDOMDocumentPtr and sysRoot is CString I'm using the above statement in a fuction and I call that fuction repeatedly to add new nodes. When I add the first nodes, I don't get any exception, but, second time I get an Exception and the program terminated. I tried with createNode function and got the same error. Can anybody help? Binayak Bhattacharyya
whats the exception?
"When the only tool you have is a hammer, a sore thumb you will have."
-
Hi, I'm using MSXML to produce a XML Doc from a Tree Control in my VC++ program. I am getting an weird error while trying to create XMLNodes. IXMLDOMNodePtr DOMNodePtr[100]; DOMNodePtr[i]=ptrDocIP->createElement(strRoot.AllocSysString()); //ptrDocIP is of type IXMLDOMDocumentPtr and sysRoot is CString I'm using the above statement in a fuction and I call that fuction repeatedly to add new nodes. When I add the first nodes, I don't get any exception, but, second time I get an Exception and the program terminated. I tried with createNode function and got the same error. Can anybody help? Binayak Bhattacharyya
Hi This probably doesn´t help but when I used lstElement->Item(0)->NamespaceURI in creating an xmlElemnt XmlElement *NameElement = doc->CreateElement("Name",lstElement->Item(0)->NamespaceURI); given that doc is an XMLDocument and lstElement is of type XmlNodelist. I got it to work. But again, I assume that there are two different problems. I added elements to an existing XMLDocument. Regards Daniel