868 Posted Topics

Member Avatar for heavyc

[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.

Member Avatar for WolfPack
0
138
Member Avatar for Dani

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.

Member Avatar for server_crash
0
179
Member Avatar for WolfPack

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; …

Member Avatar for WolfPack
0
364
Member Avatar for osean

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 …

Member Avatar for osean
0
591
Member Avatar for souphmars

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

Member Avatar for WolfPack
0
57
Member Avatar for atrusmre

Try [URL=http://msdn2.microsoft.com/en-US/library/fa1e993e(VS.80).aspx]CWnd::IsWindowEnabled[/URL]

Member Avatar for WolfPack
0
132
Member Avatar for Nedals

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?

Member Avatar for Nedals
0
955
Member Avatar for ani_manit

There has got to be enough sample code in the internet you know, if you only google for it..

Member Avatar for WolfPack
0
83
Member Avatar for WolfPack

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 …

Member Avatar for WolfPack
0
227
Member Avatar for JoBe

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 …

Member Avatar for WolfPack
0
668
Member Avatar for JoBe

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 …

Member Avatar for JoBe
0
186
Member Avatar for ray54
Member Avatar for WolfPack
0
110
Member Avatar for AhmedHan

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 { …

Member Avatar for WolfPack
0
396
Member Avatar for vicky_dev

[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:

Member Avatar for vicky_dev
0
135
Member Avatar for tyczj

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]

Member Avatar for tyczj
0
167
Member Avatar for bg123

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 …

Member Avatar for WolfPack
0
131
Member Avatar for apcxpc

[url=http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/devcons_4esj.asp]GetDC()[/url]

Member Avatar for WolfPack
0
130
Member Avatar for Jon182

[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]== ' ' …

Member Avatar for Ancient Dragon
0
233
Member Avatar for Jon182

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.

Member Avatar for Jon182
0
84
Member Avatar for JoBe

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.

Member Avatar for JoBe
0
205
Member Avatar for lilprincss10881

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 - …

Member Avatar for WolfPack
0
80
Member Avatar for bops

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.

Member Avatar for WolfPack
0
395
Member Avatar for amuarica

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]

Member Avatar for WolfPack
0
106
Member Avatar for AhmedHan

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]

Member Avatar for AhmedHan
0
147
Member Avatar for perlsu

You should create a single structure with the required arguments as members and pass it to the _beginthread function.

Member Avatar for WolfPack
0
194
Member Avatar for perlsu

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]

Member Avatar for WolfPack
0
238
Member Avatar for osean

[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 << " " …

Member Avatar for osean
0
171
Member Avatar for perlsu

[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 …

Member Avatar for WolfPack
0
133
Member Avatar for andrax

[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.

Member Avatar for WolfPack
0
94
Member Avatar for tyczj
Member Avatar for dwks
0
152
Member Avatar for Nedals

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 …

Member Avatar for Nedals
0
276
Member Avatar for mydadisadentist

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 …

Member Avatar for WolfPack
0
162
Member Avatar for sosy2001

[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: "<< …

Member Avatar for Nedals
0
169
Member Avatar for Acidburn

[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]

Member Avatar for Acidburn
0
208
Member Avatar for sosy2001

[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 …

Member Avatar for sosy2001
0
183
Member Avatar for dreamreaver

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 …

Member Avatar for dreamreaver
0
441
Member Avatar for Zababa
Member Avatar for WolfPack
0
235
Member Avatar for KittyGirl

[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, …

Member Avatar for WolfPack
0
149
Member Avatar for rajuwani121
Member Avatar for johnroach1985

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]"

Member Avatar for AhmedHan
0
390
Member Avatar for mydadisadentist

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. …

Member Avatar for mydadisadentist
0
702
Member Avatar for ilikerps

Try using the Multi Threading Debug switch [INLINECODE]/MTd[/INLINECODE] and building the app.

Member Avatar for ilikerps
0
227
Member Avatar for mydadisadentist

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 …

Member Avatar for WolfPack
0
235
Member Avatar for mr_god_god

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++ ) …

Member Avatar for mr_god_god
0
316
Member Avatar for Geek-Master

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 …

Member Avatar for WolfPack
0
3K
Member Avatar for The Dude

Since the question is WHO... I guess you should change "Stupid Polls" to "People who start stupid polls".

Member Avatar for The Dude
0
221
Member Avatar for moznmar

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.

Member Avatar for moznmar
0
264
Member Avatar for Tryst

[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", …

Member Avatar for Jakester
0
237
Member Avatar for MaaleaRogers

[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 …

Member Avatar for MaaleaRogers
0
411
Member Avatar for gmv

[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 …

Member Avatar for Dave Sinkula
0
239

The End.