I am trying to make an application with in- and output. Input by textboxes and output by writing it to a file.
I succeeded to get text from a TextBox^ and put it in a RichTextBox^. No problem.
I succeeded to use fstream to 'print' data (string) to a file.
Now I want to combine these by using a vector<string>.
The problem I am facing is that if I do: fout << textBox->Text; that I get the following error:
1< d:\stageappvc\terminalapp\terminalapp\Form1.h(185) : error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'System::String ^' (or there is no acceptable conversion)
1< C:\Program Files\Microsoft Visual Studio 9.0\VC\include\ostream(653): could be 'std::basic_ostream<_Elem,_Traits> &std::operator <<<char,std::char_traits<char>>(std::basic_ostream<_Elem,_Traits> &,const char *)
If I want to write the
textBox->Text to my vector. I get the following error:
1>d:\stageappvc\terminalapp\terminalapp\Form1.h(194) : error C2664: 'std::vector<_Ty>::push_back' : cannot convert parameter 1 from 'System::String ^' to 'const std::string &'
I tried to find out what this String^ actually is - but I could not find an accurate answer. I also tried:
textBox->Text.toString() which failed too.
Is anyone able to help me with this? I tried to find examples of how to put TextBox data in a string, but I couldn't find anything useful...