I managed to figure out how to read data in from a text file in my program directory. How can I access a text file that is online?
try{
StreamReader^theReader = gcnew StreamReader("http://www.whatever.com/file.txt"); //not the actual address, of course
}...
Here is what happened. I made two ComboBoxes with the Microsoft Visual C++ form maker. I set them as uneditable. I wanted to change the selected index to the first text, instead of a blank space so I manually added code into the form.h file to set the selected index to what I wanted. When I...
Thanks for that link. I've searched that page for some of my other questions/problems but never thought to lookup how to parse under convert.
In case anyone is interested, the following code is what worked for me:
try{
c = Convert::ToInt32(b);
}
catch(OverflowException^g){...
I'm using Visual C++ '05 on Windows XP. Here is the code:
private: System::Void submitButton_Click(System::Object^ sender, System::EventArgs^ e)
{
String^a = serialField->Text; //from textfield
int c = 0;
String^b = a->Substring(1,8);
//parse String b into int c...how...
In my program, I can't use stringstream or the >>/<< without getting errors. Do I have to be working in main to use these? Right now, I'm working on a form application. Here's what should happen: When a button is clicked, I read in text from a field, take a substring of it, and then parse...
Sadly, I've been searching a couple hours for a one line way to parse strings into integers. It is such a ridiculously simple task that I'm almost hesitant to post this. Please keep the terminology at a low level as I am extremely new to this language.
Thanks guys!
-David
Changing the selectedIndex to 0 worked...one problem, though. When I debug the program and run it, sometimes the line changing the selectedIndex to 0 gets deleted!
Is this a bug in Visual C++ or an error on my part?
I'm rather new to C++ but not to programming (up until this morning, I didn't know how to work Visual C++ '05). In an application I'm working on, I need a comboBox that is un-editable. I figured out that I do that by changing the dropDownStyle to dropDownList. It works fine except one thing...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.