|
I think the operative word is normalized . Notice the range for dx and dy is from 0 to 65535, regardless of monitor resolution.
The MOUSEINPUT structure is not necessary as the INPUT structure already has one, like:
INPUT myInput;
myInput.type = INPUT_MOUSE;
myInput.mi.dwFlags = MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE;
myInput.mi.dx = 0;
myInput.mi.dy = 690;
myInput.mi.mouseData = 0;
myInput.mi.time = 0;
myInput.mi.dwExtraInfo = NULL;
"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
|
|
|
|
|
Ahhhhh....... Back to the forum of the language I know best. Btw, is C++ dead nowadays? It seems to be that way since most forums I've seen today show that the last message posted was in July!
Edit. Except for this one...
Regards,
Jason.
|
|
|
|
|
C++ was, C++ is, C++ will be!!
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
what different between (NULL == p) and (p == NULL)
I realy confused about this, Any advise will be help.
|
|
|
|
|
If you accidentally write "=", but not "==" which you originally want it to be, then in the first case, compiler will tell you this mistake.But in the second case, compiler will not do this.
This only prevent you to make mistakes, but I don't think this is necessary
|
|
|
|
|
Most newer compilers will give you a warning for doing an assignment operator in a conditional statement.
|
|
|
|
|
I don't know which compliers you refer to, but when I test it with VS2005(which I am using now), it doesn't give any warning.Of course, here I'm using the default warning level: level 3.
When I change it to Level 4, it indeed give a warning
|
|
|
|
|
You should always use level 4.
There shouldn't be lesser levels.
|
|
|
|
|
That's a pattern that is generally held to be rubbish nowadays.
It only works when comparing an lvalue with an rvalue, and if you can remember to do it then you can remember to use the intended operator.
|
|
|
|
|
I've always viewed the difference as purely cosmetic or "style" of the coder. Personally, I've always disliked the (NULL == p) style because when I look at code for debugging, my brain processes left to right so I want to read "if p is NULL".
|
|
|
|
|
There is no difference between (NULL == p) or (p == NULL)
Both are same.
Actually it always better to prefer ( NULL == p )
Why because,
To aviod the accident of assignment that can happen.
say you are writing a statement (p == NULL ), but accidentally you wrote as p = NULL then the whole meaning is changed.
But if you use ( NULL == p ) then forgetting to give NULL = p will give compiler error.
From early days of programming this was a common error, so it now a standard to use as (NULL == p), which applicable to all the constants. It is always better to write constants on right side.
Величие не Бога может быть недооценена.
|
|
|
|
|
Hi,
I hereby claim first post!.
Thank you for helping, it is appreciated.
Could someone share with me how we can simulate a user moving the mouse around and clicking on stuff?
I need to know how you tell the mouse go there (meaning to any pixel of the lcd), click, wait go there, click again, etc.
This kind of behavior is mostly documented on the internet for situation that appears to be within the program's window using setcursorpos, getcursorposition for example: http://en.allexperts.com/q/C-1040/2008/1/Mouse-Tracking.htm[^]
Thank you
Antoine
|
|
|
|
|
Hi,
search for the SendInput() function and the INPUT and MOUSEINPUT structures.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
|
Messing around trying to learn something and I'm having trouble seeing the time benefits in my openMP example.
Each array (pArray1 and pArray2) hold about 10meg of RGB bitmap data, bufferSize2 is the bmp file size. OpenMP is enabled in VS.
So I can run the following with or without #pragma and get the same 20Msec's or there about.
<br />
<br />
#pragma omp parallel for //<-no impact on time<br />
for(long loop=0;loop<bufferSize2;loop++)<br />
pArrayResult[loop]= ~(pArray1[loop] - pArray2[loop]);<br />
<br />
I can try the common openMP example:
<br />
#pragma omp parallel<br />
{<br />
printf("hello world");<br />
}<br />
and never get something that looks like the example warning
helhelloo w world orld
I always get
hello world hello world
I can try
<br />
#pragma omp parallel<br />
{ <br />
int ID=omp_get_thread_num();<br />
printf("Hello(%d)",ID);<br />
printf("world(%d)",ID);<br />
}<br />
and the result is always sequential
hello(0)world(0) hello(1) world(1)
Anyone have an idea as to why everything seems sequential? What am I doing wrong?
Thanks,
Andre
modified on Friday, October 23, 2009 8:59 AM
|
|
|
|
|
Bump. Ow, no Bump.
modified on Friday, October 23, 2009 12:27 PM
|
|
|
|
|
I'm trying to fix an MFC app that puts up a "Failed to create empty document" for some customers when they try to open a data file. It hasn't failed on any of our own systems or for our customers in North America, but only for a customer in Sweden and one in Australia. It fails in both Win XP and Vista. The user has admin privileges. I installed those on a test machine of my own, setting the language to Australian and the locale to Australia, and installing the same anti-virus as the Australian customer, but nothing I do can reproduce the problem locally.
It's failing somewhere in MFC's OpenDocumentFile() function. Does anyone have an idea why it would work fine in the United States, but fail in Australia? It's not even reading a file yet, just trying to create an empty doc.
Thanks in advance for your help.
Dave Goodman
dgoodman@infoway.com
dkgoodman.com/blog.html
"Actio sequitur esse."
|
|
|
|
|
Dave,
I was adding some functionality to an MFC app that has been running for 10 years. I started getting the "Failed to create empty document" message. I stepped into the constructor of my document class and its base class and all the other objects that were being created. The constructor of one of my objects was getting a pen style out of a configuration file that contained a bogus value. The class was attempting to create a pen with "new CPen(..." using the bogus pen style value. The constructor of CPen threw an exception eventually causing the document class to exception out resulting in the infamous "Failed to create empty document" message. Perhaps your customers in Sweden and Australia have some bogus data in either their data files or some configuration file.
|
|
|
|
|
What does additional exception params mean. How to decode them
Exception code: c0000417
Additional params 1: bc2f
Additional params 2: a1e3a477b6e1fdbadac6c68bdf7431d9
Additional params 3: a3b3
Additional params 4: 7bd20c8dcbae52a3e1bbda9149a93f62
Чесноков
|
|
|
|
|
Hi,
My dll is creating connection to a sybase database. I am using ex_connect to connect the sybase.But while i am trying to build the code,after coming to the function ex_connect my debugger is not returning anything.Neither it is giving any error nor returning anything.
But while i used the same code(written in dll) in an executable file to test, it was working fine.
I need your help. Thanks in advance.
|
|
|
|
|
I have Dialog Box in SDI application. How to write data from Dialog to Document not closing the dialog box (just clicking the button).
Thanks for any help
BC
|
|
|
|
|
Make the dialog modeless.
"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
|
|
|
|
|
OK. I have changed my dialog to modeless but how to interact between dialog and document. For example:
In dialog I have number in edit box and on click "add" button I want this number to be written in new line on document.
Thanks for any help.
|
|
|
|
|
kudlaty79 wrote: OK. I have changed my dialog to modeless but how to interact between dialog and document.
Post a message to it. When the document receives the message, it can then notify the view (i.e., UpdateAllViews() ) that it needs to render the new data.
"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
|
|
|
|
|
OK.
But can you give an example?
like:
when clicked add on dialog write "hello" on document
Thanks for help.
|
|
|
|