I have made a application for high resolution images.
when I want to allocate large amount of memory, the system says "Application has requested the Runtime to terminate it in an unusual way." But what I want is, the allocated pointer must return 0 Or NULL that I can show my message. It does not return zero/NULL why ? any idea? I checked with debug, before proceeding to MessageBox, it gives this error. what to do here to display my message ?
And is there a way to check that the user is going to allocate large enough memory than the computer PC capacity ?
Thanks.
ImageW = 2000;
ImageH = 2000;
point *Img = NULL;
Img = new point[ImageW*ImageH];
if(Img== NULL)
{
MessageBox(0, "Your computer memory is too small.", "Error", MB_ICONERROR | MB_OK);
return;
}