Current location: Hot Scripts Forums » Programming Languages » C/C++ » New returns NULL


New returns NULL

Reply
  #1 (permalink)  
Old 05-11-04, 10:17 AM
Neb Neb is offline
New Member
 
Join Date: May 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation New returns NULL

I'm working on a Direct3D application that uses the D3DSprite class. I don't think my error is related Direct3D. Whenever I try to allocate memory for a new class, operator new and malloc return NULL pointers. The MSDN says that this means there isn't enough memory on my system, but I know that's not true, because I can run other programs from my compiler and don't have these problems. I had this error once before, but a restart fixed it, but no such luck this time. What's going on?
Reply With Quote
  #2 (permalink)  
Old 06-11-04, 03:37 AM
anirbanm anirbanm is offline
New Member
 
Join Date: Jun 2004
Location: Kolkata
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Lightbulb

If there is insufficient memory for the allocation request, by default operator new returns NULL. You can change this default behavior by writing a custom exception-handling routine and calling the _set_new_handler run-time library function with your function name as its argument.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
login script cyberted Script Requests 2 05-06-04 01:57 AM
Newbie MySQL fccolon PHP 2 03-16-04 10:54 AM
MySQL Query problem Wraith PHP 5 03-06-04 05:16 PM
picking random entries with a filter... Double selection problem dsumpter PHP 7 11-16-03 07:19 PM
Help with making a installer config script dazz Job Offers & Assistance 3 09-29-03 02:51 AM


All times are GMT -5. The time now is 01:23 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.