Access Violation Question

Started by
1 comment, last by nickmerritt 21 years ago
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
Nick
Advertisement
Show the code, your description is confusing.
Do you create a directdraw surface for that pointer to point at before you use it? Do you pass ''this'' to a function in the ctor?
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
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!
Bungo!

This topic is closed to new replies.

Advertisement