Archived

This topic is now archived and is closed to further replies.

CDX help plz

This topic is 5746 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am writing a small game. Everything works fine, but there is one small bug that is annoying me. Whenever I quit the game, I get an error: "Application Error The instruction at "0x00413adb" referenced memory at "0xddddddd1". The memory could not be "read"." Anyone know what could be causing this? .sen PS: I am using CDX, though I dont know if my problem has anything to do with CDX. .sen Edited by - Senses777 on March 18, 2002 2:47:55 PM

Share this post


Link to post
Share on other sites
Sounds like your simply accessing memory that hasn''t been allocated yet... Make sure you are calling a new for every pointer and of course delete when your done with it... Other than that, it''s hard to say without seeing the code.

Always remember, you''''re unique. Just like everyone else.

Share this post


Link to post
Share on other sites
Formulate a logical method for tracking the bug. For example, comment out everything possible, ao that you no longer get the error. Then start uncommenting until the error returns. That narrows it down. You can then use the same process withing the function causing the problem, etc, etc.

Sound like you are doing stuff with an unitialised pointer though - ddddddd1 is a strange address.

Share this post


Link to post
Share on other sites
I have tried both those things, because I figured it was calling an uninitialized pointer, but I couldn''t find it. I will try a couple other things untill I call a function to destroy the error message =) .sen

Share this post


Link to post
Share on other sites
sounds like you are calling Release() on an object you already released. since 0xddddddd1 is a debug address that pointers get set to in debug mode when freed. check and make sure you dont double Release() anything. releaseing things in a destructor can spell doom sometimes. also make sure that when you free anythng you set the pointer to NULL, and checks like:

if(Objptr)
Objptr->Release();
Objptr=NULL;

this assumes that Objptr is a dx object.

Share this post


Link to post
Share on other sites
Thanks a person! I will remember that. It was exactly the problem, and somehow I missed it when I stepped through the program ending. I released a pointer to an object, then I released a pointer that shouldn''t have been released at all, because it was a dynamic pointer between two objects to use the currently pointed object. Silly me! thanks again! .sen

Share this post


Link to post
Share on other sites