I am attempting to create a GUI for a console C++ program in Visual C++. Apparently, it is like learning the language all over. Here is my problem:
I am attempting to write the contents of a textbox to a file, but I get the error "error C2228: left of '.Text' must have class/struct/union".
Here is my problem spot, i think:
private: System::Void addtxt_Click(System::Object^ sender, System::EventArgs^ e) {
std::ofstream fout;
fout.open("callie.txt");
fout<<txtbox.Text;
fout.close();
}
However, the entire source code is here, if you want to look: http://powermite.pastebin.com/f70e98790
It compiles and runs fine if I try to write a set string to the file, such as "Hello", but it won't take the contents of the text box...
I have searched and read nearly everything I could find on the error on Google, but it seems as though it is a different fix every time, none of which really apply to my situation.
Thanks in advance for any help!