Click here to Skip to main content
15,902,198 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: pointer and switch Pin
CPallini30-Oct-09 11:00
mveCPallini30-Oct-09 11:00 
GeneralRe: pointer and switch Pin
kbury30-Oct-09 11:05
kbury30-Oct-09 11:05 
GeneralRe: pointer and switch Pin
kbury30-Oct-09 11:06
kbury30-Oct-09 11:06 
GeneralRe: pointer and switch Pin
CPallini30-Oct-09 11:23
mveCPallini30-Oct-09 11:23 
Questionhow to fit the result application from WinExec() in a splitter window? Pin
Member 333413529-Oct-09 8:01
Member 333413529-Oct-09 8:01 
AnswerRe: how to fit the result application from WinExec() in a splitter window? Pin
«_Superman_»29-Oct-09 8:13
professional«_Superman_»29-Oct-09 8:13 
GeneralRe: how to fit the result application from WinExec() in a splitter window? Pin
Member 333413530-Oct-09 2:26
Member 333413530-Oct-09 2:26 
QuestionConverting data from TextBox (String^) to string Pin
iMikki29-Oct-09 7:22
iMikki29-Oct-09 7:22 
Hello people,

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...

Kind regards,
Mikki Weesenaar
AnswerRe: Converting data from TextBox (String^) to string Pin
transoft29-Oct-09 7:32
transoft29-Oct-09 7:32 
GeneralRe: Converting data from TextBox (String^) to string Pin
iMikki29-Oct-09 7:44
iMikki29-Oct-09 7:44 
AnswerRe: Converting data from TextBox (String^) to string Pin
«_Superman_»29-Oct-09 7:48
professional«_Superman_»29-Oct-09 7:48 
GeneralRe: Converting data from TextBox (String^) to string Pin
iMikki29-Oct-09 8:05
iMikki29-Oct-09 8:05 
GeneralRe: Converting data from TextBox (String^) to string Pin
«_Superman_»29-Oct-09 8:10
professional«_Superman_»29-Oct-09 8:10 
GeneralRe: Converting data from TextBox (String^) to string Pin
iMikki29-Oct-09 8:16
iMikki29-Oct-09 8:16 
GeneralRe: Converting data from TextBox (String^) to string Pin
«_Superman_»29-Oct-09 8:17
professional«_Superman_»29-Oct-09 8:17 
GeneralRe: Converting data from TextBox (String^) to string Pin
iMikki29-Oct-09 8:20
iMikki29-Oct-09 8:20 
GeneralRe: Converting data from TextBox (String^) to string Pin
«_Superman_»29-Oct-09 8:23
professional«_Superman_»29-Oct-09 8:23 
GeneralRe: Converting data from TextBox (String^) to string Pin
iMikki29-Oct-09 8:26
iMikki29-Oct-09 8:26 
GeneralRe: Converting data from TextBox (String^) to string Pin
«_Superman_»29-Oct-09 8:28
professional«_Superman_»29-Oct-09 8:28 
GeneralRe: Converting data from TextBox (String^) to string Pin
iMikki29-Oct-09 8:31
iMikki29-Oct-09 8:31 
GeneralRe: Converting data from TextBox (String^) to string Pin
«_Superman_»29-Oct-09 8:32
professional«_Superman_»29-Oct-09 8:32 
GeneralRe: Converting data from TextBox (String^) to string Pin
iMikki29-Oct-09 8:35
iMikki29-Oct-09 8:35 
GeneralRe: Converting data from TextBox (String^) to string Pin
«_Superman_»29-Oct-09 8:36
professional«_Superman_»29-Oct-09 8:36 
GeneralRe: Converting data from TextBox (String^) to string Pin
iMikki29-Oct-09 8:41
iMikki29-Oct-09 8:41 
QuestionTerminateProcess() and windows messages. Pin
Souldrift29-Oct-09 4:23
Souldrift29-Oct-09 4:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.