G
Guest
Anyone know how to stream MXXMLWriter to a file? No matter what I try I end up with an empty file. My last attempt
MSXML2::IMXWriterPtr pWriter
hr = pWriter.CreateInstance(__uuidof(MSXML2::MXXMLWriter40))
_ASSERT(SUCCEEDED(hr))
ISAXContentHandlerPtr pContentHandler
pContentHandler = pWriter
ofstream m_pFileStream;
m_pFileStream.open( outFile, ios:ut )
pWriter->put_output( _variant_t(m_pFileStream) )
hr = pContentHandler->startDocument()
<write some xml
hr = pContentHandler->endDocument()
m_pFileStream.close()
MSXML2::IMXWriterPtr pWriter
hr = pWriter.CreateInstance(__uuidof(MSXML2::MXXMLWriter40))
_ASSERT(SUCCEEDED(hr))
ISAXContentHandlerPtr pContentHandler
pContentHandler = pWriter
ofstream m_pFileStream;
m_pFileStream.open( outFile, ios:ut )
pWriter->put_output( _variant_t(m_pFileStream) )
hr = pContentHandler->startDocument()
<write some xml
hr = pContentHandler->endDocument()
m_pFileStream.close()