Sign in to follow this  
Followers 0
JohnOne

PixelSearch being weird.

2 posts in this topic

#1 ·  Posted (edited)

When I first used AutoItx It was with visual studio 2008, and this code worked fine

#include <Windows.h>
#include "AutoIt3.h"
int APIENTRY WinMain(HINSTANCE hInstance,                   
            HINSTANCE hPrevInstance,                    
            LPSTR    lpCmdLine,                 
            int  nCmdShow){
long xx = 0;
long yy = 0;
LPPOINT ptr = new POINT();
AU3_PixelSearch(0,0,1024,768,0xFFFFFF,0,1,ptr);
xx = ptr->x; // at this point I get the exception as though ptr is NULL, exception will occur if ptr is referenced in any fashion
yy = ptr->y;
AU3_MouseMove(xx,yy,5);
return 0;
}
Now I am using VS 2010 and I get an unhandled exception of access violation.

The error is as follows

Unhandled exception at 0x1001c86e in PSearch.exe: 0xC0000005: Access violation reading location 0x00000008.

Which after a search seems to occur when referencing a NULL pointer.

ptr can be accessed and referenced before the call to AU3_PixelSearch() which seems to have an undesired affect on it.

Any Ideas what might cause this?

OS = Win7 32

EDIT:

Also during debugging I noticed that that ptr->x had been filled (for want of a better word) with a value but ptr->y had not.

Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites



Yes, PixelSearch just will not work in AutoItX. We've both referenced it correctly. I tried using older/newer DLL's, but still no success.

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