|
Here is my code. I have two loops, and during the execution of those loops I try to hit the mouse button, but always get zero when I test the state of the mouse button
void DoLoop(void)
{
long int count;
int value,i;
FILE *ofile;
ofile = fopen("test.txt","wt");
fprintf(ofile,"In Loop\n");
for (i = 0; i < 100; i++)
{
for (count=0; count < 1000000; count++)
{
value = GetAsyncKeyState(VK_LBUTTON);
if (value > 0) fprintf(ofile,"Value of VK_LBUTTON is %li\n",value);
}
printf("i = %i count = %li\n",i,count);
}
fclose(ofile);
}
|
|
|
|
|
are you pressing the LButton during execution of program? more over it's seems to be console based applciation? is i am correct?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Yes, you are correct. I just did a quick console application to test things. And yes I am pushing the mouse key during the execution.
|
|
|
|
|
I found the problem with my code. The function sets the most significant bit, so the value becomes negative. In my code I was testing for a value greater than zero instead of a non-zero value.
|
|
|
|
|
i need the code for Programming C of this question. urgent... anyone please help me...
must using "array" or "for loop"
1 1 1 1 1 0
1 1 1 1 0 2
1 1 1 0 2 2
1 1 0 2 2 2
1 0 2 2 2 2
0 2 2 2 2 2
modified on Wednesday, April 1, 2009 10:18 AM
|
|
|
|
|
int Matrix[6][6] =
{
{ 1, 1, 1, 1, 1, 0, },
{ 1, 1, 1, 1, 0, 2, },
{ 1, 1, 1, 0, 2, 2, },
{ 1, 1, 0, 2, 2, 2, },
{ 1, 0, 2, 2, 2, 2, },
{ 0, 2, 2, 2, 2, 2, }
};
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Good. Now, please show me how to make a matrix of 256x256.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Don't push me - I might just do it
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
int table[256][256];
int row;
int column;
for(row=0;row<256;row++)
{
for(column=0;column<256;column++)
printf("%d",table[row][column]);
printf("\n");
}
|
|
|
|
|
Sorry your code didn't pass the test, Can you spot why?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Why? what's really wrong? I don't find any. May be he's not assigning any value?
|
|
|
|
|
He made just one biiiiiiiiiig column (no blanks in the printf )!
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
ok
|
|
|
|
|
use loop
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
i need do it using array list or for loop wan... thx
|
|
|
|
|
mmlyh08 wrote: array list
What do you mean by that? C has no such concept as an 'array list'.
If (as I suspect) this is a homework assignment - do it yourself. Homework's there for you to learn, not (just) because your teacher's a sadistic monster. And if you're not up to doing it...well, software development's not the career for you.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I'm really wondering who downvoted you . Anyway, I balanced the vote...
|
|
|
|
|
How to make Matrix Using C
If C doesn't fit your budget, you could contact Keanu reeves.
|
|
|
|
|
oh, i am thinking about calling neo!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
How get value of variable that is in class View to
another class CAdodc_MDI()
LRESULT CADO_MDIView::OnGoodbye(WPARAM wParam, LPARAM lParam)
{
CString m_s(L”TEXT”);
}
for example another class:
BOOL CAdodc_MDI::OnInitDialog()
ADD the string:
#include "ADO_MDIView.h"
Set into file of implemetation ( three of variants)
// Adodc_MDI.cpp : implementation file
#include "stdafx.h"
#include "ADO_MDI.h"
//-1 #include "ADO_MDIView.h"
#include "Adodc_MDI.h"
//-3 #include "ADO_MDIView.h"
#include "UpdateDlg.h"
#include "MyModeless2.h"
#include "ADO_MDIView.h"
appwar below errors:
ado_mdiview.h(19) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
ado_mdiview.h(19) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
ado_mdiview.h(19) : warning C4183: 'GetDocument': missing return type; assumed to be a member function returning 'int'
|
|
|
|
|
Those errors have nothing explicitly to do with getting the variable value - you've got a syntax error somewhere in your code (maybe around line 19 of ado_mdiview.h, perchance?). Of course, it's difficult to tell, as you haven't posted the relevant bit of code!
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
PLEASE, who can more
exactly
|
|
|
|
|
Are you practicing sentence fragmentation?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
I can't comment on problem you facing, but spotted one error above :-
CHIVOTIOV wrote: LRESULT CADO_MDIView::OnGoodbye(WPARAM wParam, LPARAM lParam)
{
CString m_s(L”TEXT”);
}
you forget to return something from above function!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
I'm writing a C++ program which minimizes a batch file to the system tray. I want to add a piece of code which will change the system tray icon if the batch file updates (that is, another line is printed onto the cmd.exe window)
Any ideas on how I could do this?
Thanks
|
|
|
|
|