Hello. I'm still fairly new to C++, and I'm using the cookie-cutter style coding built into Visual Studio 2005 to help me out. From there, I'm adding additional code as needed.
What this means for me is, when I have a text box on a form, the default type of the Text field seems to be System::String^.
I'm trying to take a user input of integers in the text boxes to output to a binary file. Then, that file is made available to another program. I've got the file i/o all figured out, but when I try to take the value of the text box, I get an error that I can't convert from 'System::String ^' to 'int'.
This make sense to me as well, but I can't figure out how to get the data type of the text box to default to int (or maybe there is another method of doing what I am trying to do...). I have tried to cast with (int) and static_cast<int>, but these did not help.
I noticed that on other forms controls (for example, the progress bar control) there is a property called 'Value', but this is just not present for the text box control.
Here is what I am currently doing in short form...
Is there any way to make this conversion or is there another way to do this?
Thanks very much!
What this means for me is, when I have a text box on a form, the default type of the Text field seems to be System::String^.
I'm trying to take a user input of integers in the text boxes to output to a binary file. Then, that file is made available to another program. I've got the file i/o all figured out, but when I try to take the value of the text box, I get an error that I can't convert from 'System::String ^' to 'int'.
This make sense to me as well, but I can't figure out how to get the data type of the text box to default to int (or maybe there is another method of doing what I am trying to do...). I have tried to cast with (int) and static_cast<int>, but these did not help.
I noticed that on other forms controls (for example, the progress bar control) there is a property called 'Value', but this is just not present for the text box control.
Here is what I am currently doing in short form...
Code:
int Value1;
Value1 = this->Value1TextBox->Text;
(write Value1 to file with int type)
Is there any way to make this conversion or is there another way to do this?
Thanks very much!