MFC prevents bad_alloc from being thrown

According to the C++ standard, the new operator should throw std::bad_alloc if it fails. This will typically happen if your process has run out of memory. However, this isn’t the case if your program uses the (rather outdated) Microsoft Foundation Classes. In this post, we’ll look at what’s going on, and what you can do about it.
Read more MFC prevents bad_alloc from being thrown