Yes, you need to override global operator new on VC6 to comply with the
standard:

For non-MFC:
        #include <new.h>
        Call _set_new_handler witha ptr to a function that throws
std::bad_alloc.

For MFC
        #include <afx.h>
        Call AfxSetNewHandler witha ptr to a function that throws
std::bad_alloc.

Don't forget to restore the original handler before you exit.

There are nightmare issues with doing this for DLLs, but it can be made to
work.  
Search web and newsgroups.


-----Original Message-----
From: denis bider [mailto:[EMAIL PROTECTED]
Sent: Monday, March 24, 2003 3:12 PM
To: [EMAIL PROTECTED]
Subject: RE: SecBlock allocation


> The compiler is supposed to throw if "new" fails.

But VC6 just returns 0.

Reply via email to