Add the OutOfMemory Function

You need to add a function that displays a message box when the application is out of memory. Add the following function to the application source file:

void OutOfMemory(void)

{

MessageBox(

GetFocus(),

“Out of Memory”,

NULL,

MB_ICONHAND | MB_SYSTEMMODAL);

return;

}

In the application's include file, add a forward reference to the OutOfMemory function:

void OutOfMemory(void);