Jump to content

PixelSearch being weird.


JohnOne
 Share

Recommended Posts

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.

Link to comment
Share on other sites

  • 1 month later...

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...