|
I want to query foxpro database .dbf table . how to make select query
Trioum
|
|
|
|
|
Does FoxPro have ODBC drivers?
"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
|
|
|
|
|
INPUT myInput;
myInput.type = INPUT_MOUSE;
MOUSEINPUT mouseInput;
mouseInput.dwFlags = MOUSEEVENTF_MOVE|MOUSEEVENTF_ABSOLUTE;
mouseInput.dx = 0;
mouseInput.dy = 690;
mouseInput.mouseData = 0;
mouseInput.time = 0;
mouseInput.dwExtraInfo = NULL;
myInput.mi = mouseInput;
SendInput(1, &myInput, sizeof(INPUT));
PROBLEM 1: The mouse is moved at the upper-left corner while through this code, I am requesting him to move to BOTTOM-LEFT corner? Why this is not happening.
PROBLEM 2: I want to send event MOUSEEVENTF_RIGHTDOWN ( right button pressed at BOTTOM-LEFT), and request the system that please feel like as I click you at start button , but it is not accepting my command, I changed the flag to mouseInput.dwFlags=MOUSEEVENTF_RIGHTDOWN|MOUSEEVENTF_ABSOLUTE; So What is wrong ?
|
|
|
|
|
did u called SetCursorPos to set the cursor to that possition before sending the mouse input?
Величие не Бога может быть недооценена.
|
|
|
|
|
VOW you are GENIOUS. THANKS. Now I also find the solution of problem2 that I pasted below.
Actually in none of the article that are related with the SendInput , anyone talked about SetCursorPos. I guess it is good to call SetCursorPos first and then use the SendInput() function.
1- First Call SetCurPos()
2- then Call the SendInput() to perform the mouse events like button down up etc.
INPUT rightClick[2];
MOUSEINPUT rightDown;
rightDown.dwFlags = MOUSEEVENTF_RIGHTDOWN + MOUSEEVENTF_ABSOLUTE;
rightDown.dx = 0;
rightDown.dy = 0;
rightDown.time = 0;
rightDown.mouseData = 0;
MOUSEINPUT rightUp;
rightUp.dwFlags = MOUSEEVENTF_RIGHTUP + MOUSEEVENTF_ABSOLUTE;
rightUp.dx = 0;
rightUp.dy = 0;
rightUp.time = 0;
rightUp.mouseData = 0;
rightClick[0].type = INPUT_MOUSE;
rightClick[0].mi = rightDown;
rightClick[1].type = INPUT_MOUSE;
rightClick[1].mi = rightUp;
// finally, send the spoofed right-click to invoke the menu
::SendInput( 2, rightClick, sizeof(rightClick[0]));
|
|
|
|
|
Another Problem:
The logic of SetCurPos()works for the right clicks and OS take the appropriate action against the right click, but it did not work for left click. When I changed both flags to MOUSEEVENTF_ LEFTDOWN in the code.
The cursor goes at the bottom-left corner but application can not trigger the start button (Window Start) event, as cursor was at that point. Actually if the cursor is at the button, then we require to have a left click at button? so how we manage a click at a button by using sendinput() method.
SetCursorPos(10,790);
INPUT rightClick[2];
MOUSEINPUT rightDown;
rightDown.dwFlags = MOUSEEVENTF_RIGHTDOWN + MOUSEEVENTF_ABSOLUTE;
rightDown.dx = 0;
rightDown.dy = 0;
rightDown.time = 0;
rightDown.mouseData = 0;
MOUSEINPUT rightUp;
rightUp.dwFlags = MOUSEEVENTF_RIGHTUP + MOUSEEVENTF_ABSOLUTE;
rightUp.dx = 0;
rightUp.dy = 0;
rightUp.time = 0;
rightUp.mouseData = 0;
rightClick[0].type = INPUT_MOUSE;
rightClick[0].mi = rightDown;
rightClick[1].type = INPUT_MOUSE;
rightClick[1].mi = rightUp;
// finally, send the spoofed right-click to invoke the menu
::SendInput( 2, rightClick, sizeof(rightClick[0]));
|
|
|
|
|
void GenerateKey(int vk , BOOL bExtended)
{
KEYBDINPUT kb = {0};
INPUT Input = {0};
// generate down
if(bExtended)
kb.dwFlags = KEYEVENTF_EXTENDEDKEY;
kb.wVk = vk;
Input.type = INPUT_KEYBOARD;
Input.ki = kb;
::SendInput(1, &Input, sizeof(Input));
// generate up
::ZeroMemory(&kb, sizeof(KEYBDINPUT));
::ZeroMemory(&Input, sizeof(INPUT));
kb.dwFlags = KEYEVENTF_KEYUP;
if(bExtended)
kb.dwFlags |= KEYEVENTF_EXTENDEDKEY;
kb.wVk = vk;
Input.type = INPUT_KEYBOARD;
Input.ki = kb;
::SendInput(1, &Input, sizeof(Input));
}
check this
Величие не Бога может быть недооценена.
|
|
|
|
|
Thanks. Though it is not a recomended method but I called the SendInput function twice and now it works
::SendInput( 2, leftClick, sizeof(leftClick[0]));
::SendInput( 2, leftClick, sizeof(leftClick[0]));
|
|
|
|
|
good,
Just check by chaning the Time stamp for the event.
Величие не Бога может быть недооценена.
|
|
|
|
|
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
|
|
|
|