run writeProp all rigth
run writeProp second Access violation - while?
void TRkcXml::writeProp(void)
{
if (FileExists(fileProp)) {
bool write = false;
XercesDOMParser *prop = new XercesDOMParser;
ErrorRep *errRep = new ErrorRep();
prop->setErrorHandler(errRep);
XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *pDoc = 0;
try {
prop->parse(fileProp);
pDoc = prop->getDocument();
if (writeValue(pDoc->getDocumentElement(), "pathxsd", "value",
fProp->deDirXsd->Text))
write = true;
if(writeValue(pDoc->getDocumentElement(), "pathinp", "value",
fProp->deDirInp->Text))
write = true;
if(writeValue(pDoc->getDocumentElement(), "pathinpsave",
"value", fProp->deDirInpSave->Text))
write = true;
if(writeValue(pDoc->getDocumentElement(), "pathinparhiv",
"value", fProp->deDirInpArhiv->Text))
write = true;
if(writeValue(pDoc->getDocumentElement(), "bic", "value",
fProp->meBIC->Text))
write = true;
if(writeValue(pDoc->getDocumentElement(), "bicrkc", "value",
fProp->meBICRKC->Text))
write = true;
if (write)
writeDocProp(pDoc, fileProp);
}
catch (...) {
ShowMessage("...");
}
delete errRep;
delete prop;
//delete
//pDoc->release();
}
}
void TRkcXml::writeDocProp(DOMDocument *docWrite, WideString pathDocWrite)
{
LocalFileFormatTarget* pXMLfile;
DOMImplementation* impl =
DOMImplementationRegistry::getDOMImplementation(L"LS");
DOMWriter* writer = ((DOMImplementationLS*)impl)->createDOMWriter();
pXMLfile = new LocalFileFormatTarget(fileProp);
writer->writeNode(pXMLfile, *docWrite);
delete pXMLfile;
writer->release();
delete impl;
}