49,761 Topics
| |
I have the following code: [CODE]HWND hwn= FindWindow(NULL,"CABAL"); HDC hdc = GetDC(hwn); COLORREF x; POINT m; m.x=50; m.y=50; ScreenToClient(hwn,&m); x=gp(hdc,m.x,m.y); if(x==CLR_INVALID) cout<<"CLR_INVALID\n"; cout<<"Red: "<<(int)GetRValue(x)<<"\n"<<"Green: "<<(int)GetGValue(x)<<"\n"<<"Blue: "<<(int)GetBValue(x)<<"\n"; [/CODE] The problem is gp( GetPixel ) always returns CLR_INVALID and white (255,255,255). Also, I find it strange that SetPixel works with any coordonates. … | |
Hi Everyone, I'm new to C++ and developing something to enhance my skill, however I find it difficult on my knowledge right now, I want to write a program similar to SMS that everytime I input a character it will automatically increase my counter, and if i will press backspace, … | |
SORRY I TRIED TO INDENT THE CODE BUT IT DIDNT WORK OUT I am trying to make a binary tree for conversion of postfix to infix. the binary trees class is as follows WHAT I HAVE TO DO AND WHAT I AN HAVING TROUBLE WITH 1) READ A POSTFIX EXPRESSION … | |
i have a program that reads in a file with shapes and numbers and tokenizes each line. after it tokenizes, it then calculates the shapes dimensions. what i need to do is make it so that this program reads in the file and stores every shape and its values into … | |
I am required to compute all Lucas numbers up to a certain number. To keep track of a summation, more specifically, the summation of all Lucas numbers you have encountered up to that point. A small example: If the user inputs a bound of 23: Lucas numbers up to 23 … | |
Ok here is what I am asking: is there any simple way to use program to program communication in a console application. Like one asks for a number and the other displays it? | |
[CODE]#include<iostream> #include<math.h> using namespace std; main() { int i; float j=1.00; cout<<"enter a no"<<endl; cin>>i; float k=(float)(log (i)/log(2)); k=k%j;//------------------error-------… "%" cann`t take float vlaue. if(k==0.00) cout<<"no "<<i<" is a power of 2"<<endl; else cout<<"sorry ! i am afraid "<<i<<" is not a power of 2"<<endl; } [/CODE] i tried this … | |
Here is a task out of a book [quote]Your task is to write a C++ program to help you convert a number into roman numerals. Roman numerals are I for 1, V for 5, X for 10, L for 50, C for 100, D for 500, and M for 1000. … | |
Hello, I am getting an error when I try to pass a linked list and an iterator to the printList function below. For some reason it does not recognize the printList function call. I get the following error on line 39. no matching function for call to 'printList(std::_List_iterator<Event, std::allocator<Event> >&' … | |
Can someone send me a example of how to copy a file from a remote folder to other remote folder? For example: I am running MyProgram on MyComputer and this program has to copy a file from a folder inside OtherComputer. This folder need user and password to allow MyProgram … | |
Hi, I'm writing a C++ script and part of it is to connect to an SQL Server. C++ is new to me so I'm still working my way around. Any help would be greatly appreciated. Many Thanks | |
Hey im just trying to get back into c++ and i cant seem to solve why this is happning? I know theres too many header files also, i just normally leave them there in practise things when im messing with colours etc. Could you also please explain why it is … | |
I'm just starting to learn C++ and I need some help. I need to be able to read in a text file and pull out numbers from the file (like a news story, etc). I will need to be able to do other checks with the numbers as well, I'm … | |
Hi friends, I need to convert this random number generator in C++ to C. Please help me. C++ code [CODE] #include <iostream> #include <ctime> using namespace std; //This class will give satisfy basic // random number considerations for // games an general apps. // WARNING: Not for Cryprographic use // … | |
i wanna use the Sleep fucntion in a CLR vc++ app, if i include windows.h it gives a huge list of errors, if i use _sleep() then it dowsnot work at many systems since its obslete. what should i do? i am bound to use CLR bcoz my code uses … | |
[code] #include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main () { int guess; unsigned int seed = time (0); srand (seed); //different spot?// int upperBound; int lowerBound; int range; char c; bool done = false; do { bool found =false; upperBound = 101; lowerBound = 1; do … | |
Who can teach me the purpose of stringStream, and how to use it, please. I have read some paper about this, but I still have something don't understand. | |
Here is the assignmnent I need to complete: "Write a program to calculate and print the result of the following two operations: 1/1 + 1/2 + 1/3 + 1/4 + 1/5 + ... + 1/99999999 + 1/100000000 and 1/100000000 + 1/99999999 + 1/99999998 + 1/99999997 + ... + 1/3 + … | |
Hello all, I am fairly new to c++ and I am completely lost right now. I am suppose to create two dynamic arrays that prompt the user to enter how big the arrays should be and it also asks the user to enter the numbers they want to store in … | |
I tried to use the code on MSDN to create Rawinput but i kept getting this error: RAWINPUTDEVICE was not declared in this scope. I am writing in c++ and direct x and i am using Code Blocks [ICODE] void RawInput(void) { RAWINPUTDEVICE Rid[2]; //keyboard Rid[0] .usUsagePage = 1; Rid[0] … | |
I am writing a program that writes log entries to an external text file and returns them upon request. When called, the return function should output the log entries between two user- submitted dates or outputs the last 100kb of the file if that's what's requested. The logfile stores each … | |
[code]#include <direct.h> int main(){ mkdir("C:\\Program Files\\Bacon"); }[/code] Creates a folder in the folder that the .exe file is in, and is called "Program FilesBacon". I think it's obvious what I wanted it to do. Help please? I'm using codeblocks if it matters. | |
Someone gave me this challenge See how large a type is by storing powers of 2 in this list of types: float, double, long double. To determine if a number will fit, start with 1.0, double it, then divide by 2 to see if you get the previous number. For … | |
hello, i started programming again after a while and i made this just to pass time/relearn the basics and stuff there is a weird issue that i can't figure out, when i input row 0 column 2 or row 1 column 2 it will fill the spot for both the … | |
Hello everyone! I have been working on a sudoku generator. My main aim is to create a completed 9x9 grid that follows the rules of sudoku. The grid should display unique numbers every time it is run i.e the numbers have to be randomised. My logic in tackling the problem … | |
I'm try to make a program that will ask a user to input a string then the string gets masked (by asterisks) and later, guess every letter (character) of the masked word until the string is fully unmasked (a la Hangman). But my problem is, after the first unmasking, the … | |
Hey, I need to know what identifier i can use instead of string that will output all of the words that you type in the program. For example: if i was to use string ans1; cout <<"How are you?: "; cin >>ans1; and for my answer i typed "very good"...it … | |
i am fixing something and i have that fuction in it [CODE]bool DeckOfCards::checkFlush(const Card checkCards) { counter=0; cardCheck=" "; for(int x=1;x<5;x++) { cardCheck=checkCards.suits[x]; for(int y=0;y<5;y++) { found=hand[y].find(cardCheck); if(found!=string::npos) { counter++; } } if(counter==5) { return true; } counter=0; } }[/CODE] it goes here: [CODE]bool result=false; if((result=checkFlush(checkCards))==true) { return winner=5; }[/CODE] … | |
Hello I'm looking for a javascript I can use to rotate my 10 images on 10 seconds interval. | |
Hello Everyone Currently, I am using system("dir") method to call system calls. I want to know any other method for system calls in VC++ 2008. How can I call system call in VC++2008 without using system(" ") method? Any help would be appreciated Thanks |
The End.