868 Posted Topics
Re: [QUOTE=heavyc] i dont know how to set the pointer back to the beginning of the text file.. [/QUOTE] Use [URL=http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/setfilepointer.asp]SetFilePointer[/URL] to move the file pointer of an open file. | |
Re: I cant see the quote box in my home computer but can see it in my work computer. Both use LCD monitors. The new one looks good. Pity that I cant see it at home though. | |
Can anybody please tell me what is wrong with this piece of code? [code] std::string query; std::cout << "Enter the Query String :";// Type something with spaces here. e.g ( "financial instruments being traded on the American stock exchange" ); while (std::cin >> query ) { std::cout << query <<std::endl; … | |
Re: I haven't done it, but I dont think that it should be much different than listening in a single port...Just create SocketNumber1 and bind it to portnumber1, create SocketNumber2 and bind it to portnumber2, and listen on both sockets. Depending on the Socket I/O Model, you will get which request … | |
Re: There were one or two tutorials on how to intergrate OpenCV with Visual studio in the sourceforge download site itself. In addition, check [url=http://www.site.uottawa.ca/~laganier/tutorial/opencv+directshow/cvision.htm]this[/url] link too | |
Re: Try [URL=http://msdn2.microsoft.com/en-US/library/fa1e993e(VS.80).aspx]CWnd::IsWindowEnabled[/URL] | |
Re: You want to add a "Event Handler" for the event of pressing a Tab key or Return key? What Compiler of VC are you using? | |
Re: There has got to be enough sample code in the internet you know, if you only google for it.. | |
I have seen that even for code with a small number of lines, vertical scroll bars are added and we have to scroll to see all of it. Also this restriction does not seem to apply for other tags, e.g. [B][[/B][B]quote][/quote[/B][B]][/B] tags. I think that it would make the reading … | |
Re: Visual Studio has enabled Unicode support by default. So even though you have written MessageBox, as Narue said, it calls MessageBoxW because of this setting. Try setting [code]Project--->Propoerties-->Configuration Properties-->General-->Character Set [/code]to "Use Multi-Byte Character Set" or "Not Set", and compile. It should work. The usual way programmers tell the compiler … | |
Re: I am not sure if want all 16 Cabinet files. But if you want a customized installation, why not try [URL=http://www.microsoft.com/downloads/details.aspx?FamilyId=A55B6B43-E24F-4EA3-A93E-40C0EC4F68E5&displaylang=en]this[/URL] option? [Quote=MSDN] [B]Instructions[/B] * To run the installation program over the Internet, choose to download the Platform SDK for Windows Server 2003 SP1 Web Install. The installation program will … | |
Re: What has the documentation got to say about Combo boxes in Borland? | |
Re: use the [code]pRawInput->data.keyboard.Message[/code] field. It returns 0x101 when released and 0x100 ( i think it is 0x100, check the documentation just in case ) when it is pressed. You can use an if condition to check the two. something like [code] if ( pRawInput->data.keyboard.Message = 0x100 ) // Pressed { … | |
Re: [QUOTE=winbatch]I'm probably missing some math aspect here, but couldn't you convert 4.33 to a string, find out what position the . is and have your answer?[/QUOTE] I also think that this is the simplest and ,the most accurate, answer. Great solution. :idea: | |
Re: Try this. [code] Cells& Cells::operator= (const Cells& cells) { resetSize(cells.DEPTH, cells.ROW, cells.COL); for(int d=0; d<DEPTH; d++) { for(int r=0; r<ROW; r++) { for(int c=0; c<COL; c++) { array[d][r][c] = cells.array[d][r][c]; } } } return this; }[/code] | |
Re: Something like this. [code] // if there is no prime number between 1 and num, getMaxPrime() should return a 0. int getMaxPrime (int num) { int maxPrime = 0 ; for ( int i = 2 ; i <num ; i++ ) // Since between 1 and num means those … | |
Re: [url=http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/devcons_4esj.asp]GetDC()[/url] | |
Re: [code]char ch = temp[ i - 1]; // i is the current position ; i must be greater than 0 if( ch == ' ' || ch == ''')[/code] or [code]// i is the current position ; i must be greater than 0 if( temp[ i - 1]== ' ' … | |
Re: Use this. [code]while( ( (ch = strstr( ch, "jo ") ) != 0) ||( (ch = strstr( ch, ",jo ")) != 0 )) [/code] Note: I am not sure about the logic, that is your responsibility. But the syntax is okay. | |
Re: Right Click your project from the project explorer. Go to Configuration Properties->Linker->Debugging Most probably the Value in the "Generate Debug Info" should be "No". Set it to "Yes (/Debug)" and try debugging again. | |
Re: Put a brace here. [code]if (y <= x) { z = x - y; cout << "There is enough room at the meeting for " << z << " more people too attend.\n" << endl; } else { cout << "In order to have the meeting " << y - … | |
Re: Why dont you use the [URL=http://msdn.microsoft.com/library/default.asp?url=/library/en-us/debug/base/getlasterror.asp]GetLastError[/URL] Function to get the detailed error number? Then you will be able to find why it is failing. | |
Re: Guess it is because of this part. [code]int x; cin>>x; samp obj[x];[/code] either define an array of samp like [inlinecode]samp obj[ 10 ][/inlinecode] or use the new operator like this. [inlinecode]samp* obj = new samp(x);[/inlinecode] | |
Re: Modify your RegisterInput function as follows. [code] VOID RegisterInput(HWND hWnd;) { Rid.usUsagePage = 0x01; Rid.usUsage = 0x06; Rid.dwFlags = RIDEV_INPUTSINK; Rid.hwndTarget = hWnd; // The Window Handle of your window if (RegisterRawInputDevices(&Rid, 1, sizeof(Rid)) == FALSE) ErrorTest("Error registering input"); }[/code] | |
Re: You should create a single structure with the required arguments as members and pass it to the _beginthread function. | |
Re: Use this before using the Winsock Functions [CODE] WSADATA wsaData; int Ret; if ((Ret = WSAStartup(MAKEWORD(2,2), &wsaData)) != 0) { printf("WSAStartup failed with error %d\n", Ret); return; } [/CODE] | |
Re: [CODE]#include <iostream> #include <ctime> int main() { time_t time_now; time(&time_now); struct tm *tm_now = localtime(&time_now); std::cout << tm_now->tm_hour << " " << tm_now->tm_isdst << " " << tm_now->tm_mday << " " << tm_now->tm_min << " " << tm_now->tm_mon << " " <<tm_now->tm_sec << " " << tm_now->tm_wday << " " … | |
Re: [QUOTE]How can I give these arguments in project settings?[/QUOTE] If you are using Visual Studio 6.0 You can -Project--->Settings--->Debug Tab---->Project Arguments If you are using Visual Studio .NET -Project-->Properties--->Configuration Properties--->Command Arguments [QUOTE] How can I run these project from command prompt?[/QUOTE] OPen a Command Prompt Go to the Dubug or … | |
Re: [code] std::string s(itoa(x, buf, [color=red]10[/color])); s += ", "; s += itoa(y, buf, [color=red]10[/color]);; [/code] Read the specification for [URL=http://www.cplusplus.com/ref/cstdlib/atoi.html]atoi[/URL] . What is the meaning of this cast? [CODE]int x = ((int)(short)LOWORD(lParam));[/CODE] Just using [CODE] WORD x = LOWORD( lParam ) ;[/CODE] will work. | |
| |
Re: What happens when you change your code to this? [code] char buf[512] = ""; CSocket tsock; if ( hsock.Accept(tsock) == 0 ) { [INDENT]// Error return;[/INDENT] } while (1) {[INDENT]int bytes = tsock.Receive(buf,sizeof(buf),0); if ( bytes == 0 ) // No data read. Close the Socket. { [INDENT]break;[/INDENT] } if … | |
Re: This is not a programming solution, but rather a Windows Administrative Solution. But this may be easier than programming the whole thing. Search for the [B]RemoteAccess[/B] Entry in your SystemEvent Log. [code]Control Panel --> Administrative Tools --> Event Viewer-->SYstem Log[/code] You will be able to filter what you want and … | |
Re: [B]You better read about local variables, glodabl variables, and passing arguments to functions.[/B] Here is a corrected version. [CODE]#include <iostream> using namespace std; // This program takes the numerical score and outputs a letter grade.// int getScore () { [INDENT]int count; int score, cout << "\nEnter the student's score: "<< … | |
Re: [QUOTE=Acidburn]Hello, I'm wanting to print a circle to a screen, or should I say on a form. Any ideas? Thanks[/QUOTE] [URL=http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_mfc_cdc.3a3a.ellipse.asp]Here[/URL] | |
Re: [code] #include <iostream> // #include <stdlib.h> // You dont need this using namespace std; // This program reads in five numbers, find their sum, then prints the numbers in reverse.// int main () { const int numlist = 5; int num[ numlist]; int total = 0 ; // Remember to … | |
Re: Welcome to Daniweb. Regarding your Summarization Function, [CODE]float summarization(float n, int b) { float sum = 0; int count = 0; if(b == 1) { sum += n ; count++; } else if(b == 2) { sum += n ; count++; } else if(b == 3) { sum += n … | |
Re: What is your operating system? Are you trying to write a Console Application or a GUI Application? | |
Re: [QUOTE=sosy2001]Hello Kitty, can you help with with my array question? I need to store the users input into an array, then sum the numbers and then print them out in reverse.[/QUOTE] Judging by the date this thread was initiated, my guess is that KittyGirl became a KittyWoman, met a CatMan, … | |
Re: What is the database you are trying to connect to? | |
Re: Okay try the following, but not sure if it will work. I got a similar problem since I am working on a Japanese OS. Try this [CODE]_tcscpy(Kanji[1][1], [COLOR=Red]L[/COLOR]" | |
Re: Narue's method should work. But I could not get it to compile in my machine. It needs Windows XP or higher. Here is a small piece of code that resizes the window. But the dimensions should be specified in pixels, not by the number of characters as in Narue's method. … | |
Re: Try using the Multi Threading Debug switch [INLINECODE]/MTd[/INLINECODE] and building the app. | |
Re: Try something like this [INLINECODE]system("shutdown -s -t 40")[/INLINECODE] It will shutdown after 40 seconds. If you want to insert a user specified time, first prepare the command line using sprintf. [CODE] char command[ 20 ] = ""; cin >> time; sprintf( command, "shutdown -s -t %4d", time ); system( command … | |
Re: Well cant you do it on the fly? Since you know the number of inputs, do something like this. [CODE]int FIRST= 0, SECOND= 0; // Variables to store the Largest and Second Largest Numbers int input ; for ( int i = 0 ; i < NO_OF_INPUTS ; i++ ) … | |
![]() | Re: Another small thing to add that I read in the book [URL=http://www.relisoft.com/book/]C++ in Action[/URL] . Say you have a const member declared inside the C++ class. [CODE]class Planet { public: Planet( int iWeight); private: const int weight; }[/CODE] since the weight member cant be assigned a value in a standard … |
Re: Since the question is WHO... I guess you should change "Stupid Polls" to "People who start stupid polls". | |
Re: Change [CODE] //Functions void inputBooks(string bookName, string author, int isbn, float price); void displayBooks(string bookName, string author, int isbn, float price);[/CODE] to [CODE]//Functions void inputBooks(); void displayBooks();[/CODE] in the Class declaration. | |
Re: [code]int len = 0;[/code] Anything that uses [CODE]len[/CODE] wont work while it is 0. [CODE] char inputArray[len]; string2char(input, inputArray, len); errorCheck(inputArray, input, len, match); decipher(len,inputArray,ICAO,match); [/CODE] [code]string ICAO[25] = {"Alpha", "Bravo", "Charlie", "Delta", [color=red]"Foxtrot", "Echo",[/color] "Golf", "Hotel", "India", "Juliet", "Kilo", "Lima", "Mike", "November", "Oscar", "Papa", "Romeo", "Sierra", "Tango", "Uniform", "Victor", … | |
Re: [code]#include <stdio.h> void outputx(); void outputy(); void print_it( void(*)() ); // prototype void outputx() { printf("x\n"); } void outputy() { printf("y\n"); } void print_it( void(*func)() ) { //effectively becomes either outputx(); or outputy(); func(); } int main() { // pass the function outputx() to print_it() print_it( outputx ); // pass … | |
Re: [QUOTE=gmv]hi i am doing a project and i would like to know if anyone can please tell me how to write a delay or wait function in c++ which works asynchronously with other programs. :confused: Thank you for ur help. gmv[/QUOTE] Use Sleep( int waitTime ) in windows. It has … |
The End.