H
hedbonker
OK - I am new to .net C++. Trying to write a simple app that creates
an XML output file based on some values that a user puts in a form.
After looking in the help, the sample code provided was this:
XmlWriterSettings settings = new XmlWriterSettings();
settings.Indent = true;
settings.IndentChars = (" ");
using (XmlWriter writer = XmlWriter.Create("personal.xml", settings))
{
// Write XML data.
writer.WriteStartElement("Personal Information");
writer.WriteElementString("First Name", txtFname->Text);
writer.WriteElementString("Last Name", txtLname->Text);
writer.WriteElementString("E-mail", txtEmail->Text);
writer.WriteEndElement();
writer.Flush();
}
The element strings were replaced by the values on my form. Other then
that, this was the example. I also added the namespace reference to
the namespace region of my code like this: using namespace
System::Xml;
After getting a ton of errors and going back to look at the example in
the help, I noticed that it was C# and not C++ (duh).
Can anyone help me to understand what I need to do to make this work in
C++?
Thanks in advance!
an XML output file based on some values that a user puts in a form.
After looking in the help, the sample code provided was this:
XmlWriterSettings settings = new XmlWriterSettings();
settings.Indent = true;
settings.IndentChars = (" ");
using (XmlWriter writer = XmlWriter.Create("personal.xml", settings))
{
// Write XML data.
writer.WriteStartElement("Personal Information");
writer.WriteElementString("First Name", txtFname->Text);
writer.WriteElementString("Last Name", txtLname->Text);
writer.WriteElementString("E-mail", txtEmail->Text);
writer.WriteEndElement();
writer.Flush();
}
The element strings were replaced by the values on my form. Other then
that, this was the example. I also added the namespace reference to
the namespace region of my code like this: using namespace
System::Xml;
After getting a ton of errors and going back to look at the example in
the help, I noticed that it was C# and not C++ (duh).
Can anyone help me to understand what I need to do to make this work in
C++?
Thanks in advance!