You must add a function that displays a message box when your application is out of memory. To do this, add the following statements to the application source file:
void OutOfMemory(void)
{
    MessageBox(NULL, "Out of Memory", NULL,
        MB_ICONHAND | MB_SYSTEMMODAL);
    return;
}In the application's header file, add a forward reference to the OutOfMemory function:
void OutOfMemory(void);