|
The Undefeated wrote: Man, i like C# much better - it works
Yeah, C++ does not work, it is well known in the industry for that. You can find all sorts of articles on the internet about how C++ is broken. None of the software that is written with it actually works either of course. Microsoft just runs all the C++ applications through the C++ to C# converter to get them to run. Sun runs them through the C++ to Java converter and all the Linux stuff is run through the C++ to Linux converter. There is talk of dropping the C++ standard in 2008 for adoption of the "Plain English" compiler.
led mike
|
|
|
|
|
Uh huh...
Anyways yeah, apart from the slight mistake that i put a 5 instead of a 4, it still doesn't work.
Well, if i try not to close the file it works but, it still doesn't make sense.
And aslo, i have a char array with 9 entire bytes in it, mmm, when i try write it, it so very kindly writes 16 bytes, err... huh?
Im so unhappy
|
|
|
|
|
How are you writing it ? Is it null terminated ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
It is now... but i din't have to do that 4 years ago when a made a lame text-based game with c++
All it was was a load of cin cout, oh yeah.
|
|
|
|
|
You need to study up on how null terminated strings work, it really is that simple... there is no magic. Alternatively you could go back to languages like C# where you don't have to know how null terminated strings work.
led mike
|
|
|
|
|
I already fixed it, y'know, how i said in the previous post how i've now added a null char to the end.
And we still havn't solved the mistery problem of why readfile.close() crashes the app
|
|
|
|
|
The Undefeated wrote: why readfile.close() crashes the app
Must be more in your app than we know about because this works perfect for me:
ifstream ReadFile("C:\\Research\\HeadersTest.txt");
char line[256];
memset(line, 0, sizeof(char)*256);
ReadFile.getline( line, sizeof(char)*255);
cout << "Line: " << line << endl;
ReadFile.close();
led mike
|
|
|
|
|
Hmmm, no not really, i took out all the other code to test this, must just be one o' thems things, like this one time, i tried to open a file, but the contents was always empty, so i copied the file and opened it, and it worked fine ??? figure that out! (Oh and i tried opening it in various apps, as well as moving the file to a different location, restarting the computer etc.)
|
|
|
|
|
The Undefeated wrote: figure that out!
You were running a "fat" system. I have not seen behavior like that since NT4 workstation and NTFS. I WIN!!
The Undefeated wrote: i took out all the other code to test this
Not what I would do. I would start a "new" project and put "only" that code in it by typing it into the Text Wizard, not by copy-paste.
led mike
|
|
|
|
|
My system aint fat >_< its been on a diet, and it was NTFS
Just so's you know, at the time there wasn't much other code, it would have been exaclty the same.
Anyways, remeber the part where i said it worked when i used long file names? Explain that >_<
Do i win yet?
|
|
|
|
|
The Undefeated wrote: Just so's you know, at the time there wasn't much other code, it would have been exaclty the same.
Ok, so don't take my advice because.... things are going so well when you do it your way.
good luck
led mike
|
|
|
|
|
There's a C++ to Java converter????
|
|
|
|
|
Yes it is in Visual Studio, it's called the "Text Wizard"
led mike
|
|
|
|
|
Exxxxcellent.
I always knew if I could just convert everything to JAVA all would be well
|
|
|
|
|
I created a dialog-type MFC app in VS 2005. I created a handler for the OK button so I can cleanup prior to exiting. However, if the user clicks the red X in the upper right of the dialog, my cleanup code is not executed.
How do I create a handler for when the user quits via the X?
Thanks
|
|
|
|
|
Clicking the x acts like the cancel button. You could clean up in a OnCancel() override
as well as OnOk().
Mark
|
|
|
|
|
Mark Salsbery wrote: You could clean up in a OnCancel() override
as well as OnOk().
Which requires "cleanup" code to be in two spots. Why not do it in just one central spot?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: Why not do it in just one central spot?
I don't know...why not?
That's why I wrote "You could ..." instead of "The only way to do it is ..."
|
|
|
|
|
VFaul wrote: How do I create a handler for when the user quits via the X?
If you want to account for all methods of dismissing the dialog (OK, Cancel, Alt+F4, "X"), handle the WM_DESTROY message.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Good evenning everybody !
In my combobox i want that the values are fields from the database
when I click on the combobox a popup appear which contain different recordset from the database
I saw an example like this but i forget where it was can you help me?
|
|
|
|
|
zizzzz wrote: In my combobox i want that the values are fields from the database
Do you mean rows or columns?
zizzzz wrote: when I click on the combobox a popup appear which contain different recordset from the database
There's several things here. What exactly are you needing help with?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I think rows like in the MFC GRID
|
|
|
|
|
Given that a row is comprised of one or more columns, are you wanting a full rows worth of data in the combobox?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I want to display rows from a tabl in the database and user must select between them
|
|
|
|
|
Ok, so what exactly are you needing help with?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|