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 refer