Archived

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

Access Violation Question

This topic is 5381 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 have a C++ class with a member call LPDIRECTDRAWSURFACE lpddssurface which is a pointer; I create a new object using the constructor. Which is passes to funtion in another source file. When the funtion that gets the pointer and calls lpddssurface->restore(); (A COM/DirectX thing) it comes up with a error when i''m running the debugger. 0xC0000005/Access violation. Is that because it is in another source and I created that object in another file? Does it not have global scope?? Help! Nick

Share this post


Link to post
Share on other sites
without knowing anything about what the function you described does itd seem to me that pointer youre using either A. has not been set to something valid of B. has been set to NULL. sorry i dont know anything about what you mentioned, but i do know that trying to dereference anything with a pointer that hasnt been set to something valid (ie a known variable location or a new one, something like that) or has been set to NULL will 99.9999% of the time cause an access violation (well for the NULL pointer it always will). so id check your code to see if either you forgot something or did something you didnt mean to =/ or it could be something i know absolutely nothing about hehe

Bungo!

Share this post


Link to post
Share on other sites