Hmm, the set_new_handler isn't implemented for drivers...
    I guess I can redesign the RTL to do a throw in new, but that might not
cover all instances of new...
    How do I modify SecAlloc to do a throw in case of failure? It's a macro,
and one not easy to modify. I can't make it a function. Any ideas?

Chris Newcombe wrote:

> 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.

--
Kind regards, Dejan M. MVP for DDK
http://www.alfasp.com E-mail: [EMAIL PROTECTED]
Alfa Transparent File Encryptor - Transparent file encryption services.
Alfa File Protector - File protection and hiding library for Win32 developers.

Alfa File Monitor - File monitoring library for Win32 developers.


Reply via email to