Hi,
I'm busy working on a word processor, and I could use a bit of help with 2 things. The Savefiledialog, and the Openfiledialog. In terms of the savefiledialog, I have all the code done, and it compiles properly:
public:
void SaveFile()
{
SaveFileDialog^ saveFile1 = gcnew SaveFileDialog;
saveFile1->DefaultExt = ".txt";
saveFile1->FileName = "Untitled.txt";
saveFile1->Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*";
saveFile1->InitialDirectory = ::Environment::GetFolderPath::Environment::SpecialFolder::MyDocuments);
if ( saveFile1->ShowDialog() == System::Windows::Forms::DialogResult::OK && saveFile1->FileName->Length > 0 )
{
this->txtdisplay->SaveFile( saveFile1->FileName );
}
}
(txtdisplay is the richtextbox) This all works well, but only one problem. Let's say we typed in the file, 'This is a test'. When you save it and then open it in notepad, this is what it looks like:
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Arial;}}
\viewkind4\uc1\pard\fs20 this is a test\par
}
see? a whole lot of crap is added to the text file. How can I fix this?
Second of all, I can't even think of any good C++ code for the OpenFileDialog that'll work, I searched google, and none on there either.
Thanks a ton to anyone who can help.