Hi All,

I am using list class in my project(MFC Application). I have made list like .....

typedef std::list <RECT> rectlist; // Here list is of type RECT

in one header file. And during my project execution I am storing rectangles in the list.

And now,When I use list iterator in another class like below....( I have already included its header file in using class)

rectlist::iterator i;

And i use this iterator like below in any other function......

for (i = rects.begin(); i != rects.end(); i++)
{
CaptureScreen(*i, m_mainbuff); // Error is here
}

I got error msg like ...

list iterator not dereferencable

at runtime in debug assertion Failed Box.

Thanks in Advance...

Ashish