Sign in to follow this  
Followers 0
hoang anh

error when call cursortool.dll to much

10 posts in this topic

#1 ·  Posted (edited)

func _run()
$size = WinGetPos("")
$tam_x= $size[0]+470
$tam_y= $size[1]+380

    $r = 20
    $alpha = 0
    $n = $n +1
    Do
        $r = $r +1
        $alpha =$alpha + 0.2

        $x = $r*sin($alpha)
        $y = 3/4*$r*cos($alpha)


        MouseMove($x+$tam_x, $y+$tam_y, 0)
        $ReturnArray = DllCall("CursorTool.dll", "int", "GetCursorId")
        
        If $ReturnArray[0]= 8760 then
            mouseclick($click, $x+$tam_x, $y+$tam_y, 1, 0)
            $cursorId = return[0]
            $r = 20
            $alpha = 0
            sleep(GUICtrlRead($input)*1000)
        EndIf
    until $r > 400
return
endfunc

Working nice about 5mins. After that, mouse still moving without click ( seem dllcall not working, cant check Mouse ID)

Maybe cause I use DllCall("Cursortoll.dll") to much. And make window error. Cant do it any more.

http://www.geocities.com/subnetjet/CursorTool.zip

( cursortool.dll made by Kageroo use VB)

Edited by hoang anh

Share this post


Link to post
Share on other sites



You would do better by opening the Dll and calling using the Dll handle.

$dll = DllOpen("cursortool.dll")
...
$ReturnArray = DllCall($dll, ...)
...
;at the end
DllClose($dll)

Share this post


Link to post
Share on other sites

Thx IceKirby ^^. I'm trying do it. But " dllclose($dll)" add after " return" or " before " return" ??

Share this post


Link to post
Share on other sites

before return


[font="Verdana"]In work:[list=1][*]InstallIt[*]New version of SpaceWar[/list] [/font]

Share this post


Link to post
Share on other sites

not working, still get error same before.

Share this post


Link to post
Share on other sites

Just wondering, what error are you actually getting? Is it an AutoIt error or a WIN32 error?

Share this post


Link to post
Share on other sites

i dun know how explain it. Very hard. Not Win32 error. Seem like autoit error or code error.

In my code, I used dllcall. But Func " If - return " make dllcall repeat too much. After running about 10mins, dllcall stop working while my func still working well.

Share this post


Link to post
Share on other sites

any1 help me plz :shocked:

Share this post


Link to post
Share on other sites

Yeah I get that same problem, I think maybe there is a memory leak or something. I can't explain it, but there is probably a bug in the C code somewhere. Even when you leave the DLL open and just make calls to the function the same problem happens eventually.

It works perfectly for about 5 minutes like you said, and then it's like my whole script becomes semi-unresponsive. If I recall correctly no events would get fired at all.

I originally just built the DLL directly from source code which was posted on this forum somewhere, fact is I don't fully understand how it works and haven't revisited it since I built it into a DLL. You'll need to get some C skills to fix this one. Let me know if you have any luck. I gave up on this one months ago. It's a shame it's not working because being able to identify unknown cursor types would be a really handy feature.

Share this post


Link to post
Share on other sites

How come when I run it all I get is blank? :s

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0