going crazy... wont write to filestream in loop!?
Okay I am going absolutely insane. I cannot figure out why this isnt working. I have other pieces of code just like it that work fine... but anyway here it is:
Code:
tmpstrm.open("C:\\Tplease.txt");
if(!tmpstrm.is_open())
MessageBox::Show("Not Open", "WTF", MessageBoxButtons::OK);
tmpstrm.clear();
tmpstrm << "This line writes!!!\n";
int cnt = 0;
while (!read->Contains("(END)") && cnt < 500){
read = gcnew String(connector.ReadFromPipe().c_str());
connector.WriteToPipe("\r");
To_string(read, output);
// PROBLEM HERE //
tmpstrm << "This line wont write!?!?\n";
cnt++;
}
tmpstrm.close();
I know the loop is executing as I have stepped thru the code multiple times and have even output cnt as a test to see if its getting incremented. My goal here is to write 'output' to the file but that didnt work so I am now testing with a straight string and still nada. Help