Form1.h(130): error C2664: 'System::Xml::XmlTextWriter::XmlTextWriter(System::IO::TextWriter ^)' : cannot convert parameter 1 from 'System::Xml::XmlTextWriter ^' to 'System::IO::TextWriter ^'
the code for the load settings button is directly from the example on msdn, it looks like
Stream^ myStream;
SaveFileDialog^ saveFileDialog1 = gcnew SaveFileDialog;
saveFileDialog1->Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*|XML file (*.xml)|*.xml";
saveFileDialog1->FilterIndex = 3;
saveFileDialog1->RestoreDirectory = true;
if ( saveFileDialog1->ShowDialog() == System::Windows::Forms::DialogResult::OK )
{
if ( (myStream = saveFileDialog1->OpenFile()) != nullptr )
{
UnicodeEncoding^ uniEncode = gcnew UnicodeEncoding();
XmlTextWriter myWriter = gcnew XmlTextWriter(myStream , uniEncode);
// Code to write the stream goes here.
myStream->Close();
}
}
I haven't made the xml writer actually do anything as I can't get past this error. It thinks I'm giving it an XmlTextWriter but I'm not. Any help is appreciated, thanks.

New Topic/Question
Reply


MultiQuote




|