|
My mistake.
(the linked article can still offer hints and tips).
I'd rather be phishing!
|
|
|
|
|
When it comes to resources, it could be any number of things... if you make the call within a dll and not the main application, you have to make sure to have the resources of the main application loaded and not the dll's resources.
In any case, hard to tell without more info and some code.
|
|
|
|
|
3 users are connected to one pc using 3 usb keypads. A record is shown and each user have to input a number like 7.7 or 600 or 7.5 then they will press ENTER. Done.
So as an example problem: user2 starts to type 7 and user1 starts typing 5. the computer is already getting 75. You can see the problem.
I need a utility/code to isolate the input.
I have seen it in an auction software and also using xbox playing games.
In the auction software 3 black boxes are seen in the PC. Once a user starts the black box associated with that user, turn gray. Same as the other users. When all users have pressed ENTER, All boxes are revealed with the entries.
Until now we only had to enter one digit per box, so 3 keypads were no problem. The system right now have the 3 boxes in the screen.
|
|
|
|
|
|
That is the best news I got. Thanks, many thanks.
It definitely address the objective. Now is time to digest all of it.
Thanks again. I will keep you posted
|
|
|
|
|
You're welcome! Good luck
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
Can you contact me?
How can I contact a member?
|
|
|
|
|
I would prefer it if you post follow-up questions here
That would probably also be more helpful for you, since I'm not too much into C++; so other members could help out then.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
I am not that good in c+++ and was hoping to find some one to help me to interface the code from Steve Messer and Emma Burrow.
It would be great to reach either one.
But it seems difficult.
|
|
|
|
|
In that case I would suggest to look at the other search results (articles) to find a solution that's already in C++
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
|
Hi, im a beginner programmer and new to the forum.. HI everyone
is it possible to...
1) code my website so when new customers sign up, they are automatically sign up for the hundrends of websites listed on my website/platform ?
|
|
|
|
|
Possibly, but your question has nothing to do with C++. Please try one of the Web Development forums.
|
|
|
|
|
Ohh ok thanks
|
|
|
|
|
Member 11675472 wrote: code my website so when new customers sign up, they are automatically sign up for the hundrends of websites listed on my website/platform ?
Hundreds?
Just because you can doesn't mean you should.
|
|
|
|
|
Hii
I am a beginner of C++ programming environment.
My question:
Suppose there is a array..and the contents of the array="ironman"
Now, i need to insert some additional character to this string like "i*r%o#n@m^a!n"
Also i need to reversely generate the original contents. That means from "i*r%o#n@m^a!n" to "ironman"..
Also i have one constraint, i cannot use much of library function..i can use loop only.
Thanks in Advance !!
|
|
|
|
|
What have you tried?
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
Think about how you address elements of the array; that will help you to change particular letters. Similarly that will give you a clue how to reverse it.
|
|
|
|
|
Well, it doesn't look a daunting task, however you have to allocate a new array having the double size of the original one.
Then you could copy the original items o[i] into new ones n[2*i] , finally add the 'additional characters at odd indices.
The inverse operation, is, well, inverse, namely n[2*i] -> o[i] .
|
|
|
|
|
Hi,
I want to list out the captions of all open windows on desktop (the items which all are shown on task bar). I tried using 'EnumDesktopWindows' function but it provides too many unnecessary window handles.
Can we filter the actual windows from the list provided by above API?
Regards,
Krishnakumar T. G.
|
|
|
|
|
Krishnakumartg wrote:
Can we filter the actual windows from the list provided by above API? For each window handle, check to see if it has a captain, and if it is visible. That should narrow it down.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Thanks. It worked with some hard coded exclusions like "Start", "Program manager" windows.
|
|
|
|
|
Hi,
I want to get the list of Browser Add Ons using C++. Is there any WMI query using which this can be solved or any other method to achieve the same.
Browser Can be any browser i:e: Internet Explorer, Chrome etc...
Any help will be appreciated.
Regards,
|
|
|
|
|
This information is internal to each browser, so you need to check their developer websites.
|
|
|
|
|
#include <time.h>
#include <iostream>
#include <string>
#include <iomanip>
/*http://rosettacode.org/wiki/2048*/
typedef unsigned int uint;
using namespace std;
enum movDir { UP, DOWN, LEFT, RIGHT };
class tile
{
public:
tile() : val( 0 ), blocked( false ) {}
uint val;
bool blocked;
};
class g2048
{
public:
g2048() : done( false ), win( false ), moved( true ), score( 0 ) {}
void loop()
{
addTile();
while( true )
{
if( moved ) addTile();
drawBoard();
if( done ) break;
waitKey();
}
string s = "Game Over!";
if( win ) s = "You've made it!";
cout << s << endl << endl;
}
private:
void drawBoard()
{
system( "cls" );
cout << "SCORE: " << score << endl << endl;
for( int y = 0; y < 4; y++ )
{
cout << "+------+------+------+------+" << endl << "| ";
for( int x = 0; x < 4; x++ )
{
if( !board[x][y].val ) cout << setw( 4 ) << " ";
else cout << setw( 4 ) << board[x][y].val;
cout << " | ";
}
cout << endl;
}
cout << "+------+------+------+------+" << endl << endl;
}
void waitKey()
{
moved = false; char c;
cout << "(W)Up (S)Down (A)Left (D)Right "; cin >> c; c &= 0x5F;
switch( c )
{
case 'W': move( UP );break;
case 'A': move( LEFT ); break;
case 'S': move( DOWN ); break;
case 'D': move( RIGHT );
}
for( int y = 0; y < 4; y++ )
for( int x = 0; x < 4; x++ )
board[x][y].blocked = false;
}
void addTile()
{
for( int y = 0; y < 4; y++ )
for( int x = 0; x < 4; x++ )
if( !board[x][y].val )
{
uint a, b;
do
{ a = rand() % 4; b = rand() % 4; }
while( board[a][b].val );
int s = rand() % 100;
if( s > 89 ) board[a][b].val = 4;
else board[a][b].val = 2;
if( canMove() ) return;
}
done = true;
}
bool canMove()
{
for( int y = 0; y < 4; y++ )
for( int x = 0; x < 4; x++ )
if( !board[x][y].val ) return true;
for( int y = 0; y < 4; y++ )
for( int x = 0; x < 4; x++ )
{
if( testAdd( x + 1, y, board[x][y].val ) ) return true;
if( testAdd( x - 1, y, board[x][y].val ) ) return true;
if( testAdd( x, y + 1, board[x][y].val ) ) return true;
if( testAdd( x, y - 1, board[x][y].val ) ) return true;
}
return false;
}
bool testAdd( int x, int y, uint v )
{
if( x < 0 || x > 3 || y < 0 || y > 3 ) return false;
return board[x][y].val == v;
}
void moveVert( int x, int y, int d )
{
if( board[x][y + d].val && board[x][y + d].val == board[x][y].val && !board[x][y].blocked && !board[x][y + d].blocked )
{
board[x][y].val = 0;
board[x][y + d].val *= 2;
score += board[x][y + d].val;
board[x][y + d].blocked = true;
moved = true;
}
else if( !board[x][y + d].val && board[x][y].val )
{
board[x][y + d].val = board[x][y].val;
board[x][y].val = 0;
moved = true;
}
if( d > 0 ) { if( y + d < 3 ) moveVert( x, y + d, 1 ); }
else { if( y + d > 0 ) moveVert( x, y + d, -1 ); }
}
void moveHori( int x, int y, int d )
{
if( board[x + d][y].val && board[x + d][y].val == board[x][y].val && !board[x][y].blocked && !board[x + d][y].blocked )
{
board[x][y].val = 0;
board[x + d][y].val *= 2;
score += board[x + d][y].val;
board[x + d][y].blocked = true;
moved = true;
}
else if( !board[x + d][y].val && board[x][y].val )
{
board[x + d][y].val = board[x][y].val;
board[x][y].val = 0;
moved = true;
}
if( d > 0 ) { if( x + d < 3 ) moveHori( x + d, y, 1 ); }
else { if( x + d > 0 ) moveHori( x + d, y, -1 ); }
}
void move( movDir d )
{
switch( d )
{
case UP:
for( int x = 0; x < 4; x++ )
{
int y = 1;
while( y < 4 )
{ if( board[x][y].val ) moveVert( x, y, -1 ); y++;}
}
break;
case DOWN:
for( int x = 0; x < 4; x++ )
{
int y = 2;
while( y >= 0 )
{ if( board[x][y].val ) moveVert( x, y, 1 ); y--;}
}
break;
case LEFT:
for( int y = 0; y < 4; y++ )
{
int x = 1;
while( x < 4 )
{ if( board[x][y].val ) moveHori( x, y, -1 ); x++;}
}
break;
case RIGHT:
for( int y = 0; y < 4; y++ )
{
int x = 2;
while( x >= 0 )
{ if( board[x][y].val ) moveHori( x, y, 1 ); x--;}
}
}
}
tile board[4][4];
bool win, done, moved;
uint score;
};
int main( int argc, char* argv[] )
{
srand( static_cast<uint>( time( NULL ) ) );
g2048 g; g.loop();
return system( "pause" );
}
|
|
|
|