LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I need help using the "GetCursorPos" function in the user32.dll on a machine running Win98.

I'm able to get the x axis information by setting arg1 to TYPE=Numeric, DATA TYPE=Signed 32-bit Integer, PASS=Pointer to Value. I wired a zero to the input.
When I setup arg2 the same, LabView crashes.???
This is the first time I've attempted to access a dll, and I'm not sure I'm on track with the operation and I appreciate any help with this matter.
0 Kudos
Message 1 of 5
(9,534 Views)
K,

Here is a working example. Pass the positions out as an array, by pointer.

Good Luck,

-Jim
Message 2 of 5
(9,534 Views)
Hi,

What you are doing now is:

BOOL GetCursorPos(
LPPOINT lpX // cursor's X
LPPOINT lpY // cursor's Y
);

This is not correct! The Api pop only one parameter from stack, and returns
to the second. The second parameter should be the return andress (set
automatically), but in your case it's a pointer to lpY! So LV crashes!

This is the prototype of GetCursorPos:

BOOL GetCursorPos(
LPPOINT lpPoint // cursor position
);


Wire a cluster to the first parameter (set the dll to "adapt to type"). the
cluster should have two U32's in it.

Regards,

Wiebe.


"_K_" wrote in message
news:5065000000080000004C780000-1042324653000@exchange.ni.com...
> I'm able to get the x axis information by setting arg1 to
> TYPE=Numeric, DATA TYPE=Signed 32-b
it Integer, PASS=Pointer to Value.
> I wired a zero to the input.
> When I setup arg2 the same, LabView crashes.???
> This is the first time I've attempted to access a dll, and I'm not
> sure I'm on track with the operation and I appreciate any help with
> this matter.
Message 3 of 5
(9,534 Views)
This works perfecly. Thank you very much!
0 Kudos
Message 4 of 5
(9,534 Views)
Hi,

Also try SetCursorPos. This one does works almost like your first attempt:

BOOL SetCursorPos(
int X, // horizontal position
int Y // vertical position
);

Note that the numbers are passed, not pointers to numbers.

Have fun!

Wiebe.


"_K_" wrote in message
news:506500000005000000C7D50000-1042324653000@exchange.ni.com...
> This works perfecly. Thank you very much!
0 Kudos
Message 5 of 5
(9,534 Views)