I love themouse! why won't he speak to me?
Hello my fellow programmers,
excuse my lame English...
I've been searching for months for someone to help me on this,
I'm a Java programmer, but there some things that java just can't handle...
I need to get the mouse coordinates on windows.
herer the deal:
I program in Java, so i need someone to write me a tiny bit of code in C++ to help me complete a project I'm working on.
[Clerification: The mouse coordinates needed are the screen ones, NOT the application ones. Moreover, the mouse should be free to work on WIN, untill the mouse middle button is clicked and from there on untill it is released, coordinates needs to be captured]
contact me on my ICQ# 196601267
(please! its my 12G project...)
Programmers unite!...
Hack the planet...
blah blah blah...
Re: I love themouse! why won't he speak to me?
Is this going to be windows based, or does your project require it to be used on different operating systems?
Re: I love themouse! why won't he speak to me?
Have a look at this function:
GetCursorPos()
Re: I love themouse! why won't he speak to me?
I will try to help as much as possible but i do not have alot of time at the moment as i am already working on a large project.
Could you please post more specifics of what you require?
Thanks,
P.S. (i do not have ICQ)
You can send me an e-mail if you wish, tho i cannot give this prioritay over what i am already required to do.
1 Attachment(s)
Re: I love themouse! why won't he speak to me?
Ok, ive never done anything like this b4 in terms of JNI, so its completely new to me..
however just to see if we are on the right path counld you please test the following attachment. Small steps are good steps ;)
Thanks,
Daniel
1 Attachment(s)
Re: I love themouse! why won't he speak to me?
If the above worked (i have no way of testing it) then try the folloing, it should be another step in the right direction..
With this one you should get a messagebeep on every mouse event.
Thanks
Re: I love themouse! why won't he speak to me?
thank u again for helping me, and dedicating ur time,
I've been searching for months for somebody...
I tried the first DLL and got the next response for the following main func.:
public static void main(String ar[])
{
System.out.println("Hello world from Java");
Test test = new Test();
test.accept();
}
output:
Hello world from Java
Exception in thread "main" java.lang.NullPointerException
at Test.accept(Native Method)
at Test.main(Test.java:13)
Hello Form C++ Dll
^^^^^^^^^^^^
meaning, ur function was called succesfully. we can say that for sure by the output. but an exception followed the input, sont know why. i guess its because of the "return" or Vector...
the second DLL output:
Hello world from Java
Exception in thread "main" java.lang.UnsatisfiedLinkError: accept
at Test.accept(Native Method)
at Test.main(Test.java:13)
I dont know what u wrote into both of the dll's, so send me the source so i could too understend what was intended to happen, what succesfuly happend or didn't happen. so we could discuss further tries.
for now, lets try the simple interface stated below which allows me to get the mouse x coord - this will be a good "return" try app:
[special attention to the return type called "jint" (java int i spose), do u know how to return that kind of type?]
/* machine generated */
#include <jni.h>
/* Header for class Test */
#ifndef _Included_Test
#define _Included_Test
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: Test
* Method: getMouseX
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_Test_getMouseX
(JNIEnv *, jobject); //the same routine... implementation needed
#ifdef __cplusplus
}
#endif
#endif
Re: I love themouse! why won't he speak to me?
Following whats written above, my last response,
I found this next page which i think specify an example as to how u can return java types from c++
http://www.devarticles.com/c/a/Java/...-JNI-Part-2/2/
[u really need to install icq (www.icq.com) :) ]
Re: I love themouse! why won't he speak to me?
Hi eyalW12,
good to know what first example at least called the function..
I have other commitments today however i have installed ICQ (324054990) and i should be able to spend some time on it tonight (in about 6-7 hours time).
Thanks
Re: I love themouse! why won't he speak to me?
k, i see u added me.
be online on ICQ when u're free