15,300 Posted Topics
Re: assume you used ClassWizard to name the button control m_ctrlButton, [code] m_ctrlButton.EnableWindow(FALSE); // grey (disable) the button [/code] | |
Re: maybe its a virus or something like that?? I have no such file on my computer and I have Visual C++ 2005 Pro and VC++ 6.0 installed. Is your computer setup to be an e-mail server or web server (mine is NOT)? If not, then move the file someplace else … | |
Re: [QUOTE=axiss]Hi I was just wondering how you change the text colour of only some of the text in a console when you are using cout to display your text.[/quote] it will all depend on the operating system. MS-Windows, use win32 api console functions. I don't know about *nix but probably … | |
Re: [URL="http://www.winprog.org/tutorial/"]This[/URL] is a good tutorial about how to write non-MFC programs. It shows you how to create dialog boxes from scratch. You could integrate some of it into an MFC program if you want. And [URL="http://www.codeproject.com/dialog/xmessagebox.asp"]here[/URL] is a good non-MFC XMessageBox that can be easily added to an MFC program … | |
Re: >> if(Board[row][cur_col] == Board[row + 1][cur_col- 1] && Board[row + 1][cur_col - 1] == Board[row + 2][cur_col - 2] && Board[row + 2][cur_col - 2] == Board[row + 3][cur_col - 3]) when row == 5 the above causes exception because Board[row+1] is illegal cell reference. I responded with 1 to … | |
Re: >> while (reply,reply1,reply2,reply3,reply4!= "no") that is not necessary. just create a for loop that counts from 0 to 5 -- no need to answer that question 5 times [code] for(int count = 0; count < 5; count++) { // blabla } [/code] there is no need for num1, num2 ... … | |
Re: your program has corrupted the stack someplace -- most likely buffer overflow or possibly use of uninitialized pointers. Its impossible to diagnose without seeing the entire program. I would probably start debugging by commenting out huge blocks of code until the problem goes away. Then you will know approximately where … | |
Re: I do similar, but I put that log function in another thread so that it doesn't slow down other processing. you can put the log requests into a queue, then the log function can take its own sweet time processing them. Also, I always close the file when the last … | |
Re: Yes, it can be done with c++, but it's a pretty complex and very very messy -- see this about [URL="http://support.microsoft.com/?scid=http%3a%2f%2fwww.support.microsoft.com%2fkb%2f196776%2f"]Office Automation[/URL] | |
Re: how long is this going to go on anyway? I still cannot access it from IE6 -- Firefox works ok. | |
Re: >> any suggestions upgrade to [URL="http://msdn.microsoft.com/visualc/vctoolkit2003/"]Visual C++ 2005 Express[/URL] | |
Re: >>Visual C++ 1.52, I am trying to teach myself programming well, you won't learn much by using that ancient compiler, and what you do learn will most likely be wrong. Get yourself a modern compiler -- there are several free ones that are good for learning, such as Dev-C++ from … | |
Re: why doesn't hw2head.c contain any includes? Add hw2head.h to the top of hw2head.c and that will probably fix all (or most) of the problems. | |
Re: In function input_university() I see where scanf() is reading the string, and univ->std[num_cells].name is getting allocated, but I don't see where it is copying buffer to univ->std[num_cells].name after allocation. Add this and it will probably work ok. [code] strcpy(univ->std[num_cells].name,buffer); [/code] | |
Re: [QUOTE=lsu420luv]I need to pull the Any Name Here into a variable and then use my usual[/QUOTE] the >> insert operator stops reading the keyboard when it encounters the first space. If you want the string to include spaces, then use getlin() [code] std::string full_name; getline(cin,full_name); [/code] >> Also if I … | |
Re: >>any suggestions 1. you can use ODBC, this is the oldest and most popular method of acccessing SQL databases. Just use google and you will find free c++ classes and instructions. 2. review the Enroll tutorial at [url]www.microsoft.com[/url] -- it uses MFC which you might or might not want. If … | |
The "Insert Link" button normally presents two dialogs -- one to enter some text and the other for the url. It doesn't do that any more -- only asks for the url. Will you please fix this:?: | |
Re: What compiler/version are you using? I have had warning C4530 with winCE and solved the problem by adding -GX to the compile flags. [URL="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=195818&SiteID=1"]http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=195818&SiteID=1[/URL] | |
Re: You could try to use [URL=http://www.google.com/search?hl=en&q=quadratic+equation+computer+programs&btnG=Google+Search]Google[/URL] | |
Re: MS-DOS became extinct after version 6.X. If you have MS-Windows installed on your computer than you do NOT have MS-DOS. You probably mean a command-line window, which is an MS-DOS [b]emulator[/b] | |
Re: in MS-Windows you can call win32 api function GetSystemTime() that returns a [URL="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/systemtime_str.asp"]SYSTEMTIME[/URL] structure. Other operating systems probably have something similar, but I don't know what they would be. | |
Re: did you bother reading [URL=http://www.daniweb.com/techtalkforums/thread43355.html]this thread[/URL] ? Its nearly identical assignment -- in fact that poster could also be in your class! I have already done that assignment in C and C++, but I'm not about to post the results -- wouldn't want to spoil your fun :mrgreen: I did … | |
Re: first find out how many words are on the line, count the length of all the words. subtract that from the total line length and you get the number of spaces that you have to distribute between the words. divide that number by the number of words and you get … | |
Re: One problem is that you are attempting to open the same file twice -- once in main() and again in Checkfile(). After opening the file in main() just pass the ifstream object to Checkfile. [code] while (!openfile.eof() && Record < ArrayRecord && !openfile.fail()) { //While loop, As long as the … | |
Re: >>Following code gives me an error when I use text field in CSV file instead of float or integer fields what compiler? post the errors. The compiler should give you warnings that it is converting int to char and may lose data. what does the csv file look like -- … | |
Re: >fstats[index value]++, now i'm just using pointers how would i do this?? I thought `*(fstats +1)++` would increment the second position of `fstats` array because `fstats` points to the first postion but syntax wise this does not work. I am currently placing the certain index value accrodingly, kinda like cheating. … | |
Re: the header file is incomplete. you probably didn't post the whole thing. | |
Re: I really don't know the answer, but I would start [URL=http://www.microsoft.com/technet/prodtechnol/winxppro/plan/rtcprot.mspx]here[/URL] | |
Re: what keyboard language is installed on your computer? UK and American keyboards are different scancodes for the same key. American keyboard prints '#' for the Shift-3 key, while UK prints ' £' | |
Re: use the chdir() function instead of the system() because (1) its faster and (2) its safer [code] chdir("c:\\"); [/code] ![]() | |
Re: If you want it ported to MS-Access or Oracle you will have to use their database engine to import the file into the database tables. Each database has its own unique file formats so the safest way to do it is to use the appropriate database engine. And some cost … | |
Re: you forgot to include the header file in the *.cpp file. You may also need other header files too, such as iostream, fstream, string, etc. depending on your code. [code] #include "dateSType.h" // rest of cpp code here [/code] | |
Re: you forgot to block in the code for the last if statement. [code] if (StrokeCount > 5 ) [color=red] { [/color] Par = StrokeCount%5; cout <<" You are "<< Par <<" over Par" << endl; cout << endl; [color=red] } [/color] [/code] | |
Re: >>string[strlen(string)] = '\0'; That may or may not work -- if the string does not contain '\n' the above will cut off the last character that was read. fgets() appends the '\n' ONLY if there is one in the stream -- for example if the buffer is filled up before … | |
Re: I prefer MFC only because I fairly well versed in it -- and because, like an old dog, its difficult to learn new tricks. But for younger people, learn about MFC only because there is a lot of code out there that you may encounter on-the-job. New projects would probably … | |
Re: here is a c++ version that puts the strings into a 2d vector [code] #pragma warning(disable: 4786) // VC++ 6.0 disable warning about debug line too long #include <iostream> #include <fstream> #include <vector> #include <string> using namespace std; typedef vector<string> LINE; int main() { string line; int pos; vector<LINE> array; … | |
I couldn't access it all day today from where I work using IE6. Kept getting a strange error (I don't recall what it said). But at home using FireFox it was ok. Coincidence?? | |
Re: >>I've tried the same with my VS 2005 but I didn't worked! I was misssing this .lib file that compiler will not generate a .lib file unless there are some exported symbols (either functions and/or objects). __declspec( dllexport ) will export them [code] __declspec( dllexport ) int foo; [/code] >>what … | |
Re: >>int _tmain(int argc, _TCHAR* argv[]); remove the semicolon at the end of that line | |
Re: >> if (n<1 || n>256) your array is only 10 rows and columns. If I enter a value of 255 then your program will crash bigtime. Instead of hard-coding a value like 256, create a define or const int to declare the array size and its limits [code] const int … | |
Re: your do-while loop is wrong. It doesn't even compile so I'm not supprised it has runtime errors. [code] do { strcpy (sDirName, TEXT(" -i 264\\")); lstrcpy(sFileName,FindFileData.cFileName ); strcat(sDirName,sFileName); // other stuff here } while( FindNextFile(hSearch,&FindFileData) != 0); [/code] fix that and it works. | |
Re: So, according to your description Player ID = 6010 Proficiency Level = 1 Weight Factor = 1.3 Judge = 23 Score = 7.0 Then the next set is Player ID = 25 Proficiency Level = 8.5 Weight Factor = 34 Judge = 7.0 Score = 12 That doesn't look right … | |
Re: you are attempting to use c++ techniques on C strings. use strcpy() to copy one string to another [code] char tmp[LEN]; strcpy(tmp, flight[i].first); [/code] However, that is not really what you want to do anyway -- it takes to much time to swap individual members of a structure. You want … | |
Re: why are year, month and day doubles? why not int or long? if you use the functions in <ctime> it would make your class a lot smarter -- for example the formatting you desire can be easily accomplished with strftime(). Once you know year, month and day, fill in a … | |
Re: There are lots of ways to do it, here is just one of them. The class will need public access to the private variables only if something outside the class needs access to those variables, and that's the purpose of the Get() and Set() methods. [code] #include<iostream> using namespace std; … | |
Re: The functions in conio.h are non-standard and not supported by very many compilers. Just a warning because your teacher may not be able to compile your program if he/she uses a compiler that does not support those functions. Most new programmers should not use them so that you learn the … | |
Re: Did you post your exact program? Because the code you posted doesn't fit the results you posted. >>inFile >> fName >> lName[i++] >> age >> sex >> wTime; lName array is ok, but on every iteration of that loop the program just simply overwrites whatever was read on the previous … | |
Re: in MS-Windows NT/W2K/XP, cmd.exe is the shell emulator, Win95/98 it was (is) command.com. So if you want to lock out the command prompt you will have to write your own version of either cmd.exe or command.com. It would require a firm understanding of C language and win32 api functions to … | |
Re: On MS-Windows, use FindFirstFile() and FindNextFile(). There are lots of examples how to use those two functions floating around, just use google to search for them. >>I cannot use win32 because the program would be used as an example in a class introducing the C programming language How to get … |
The End.