Jump to content
  • Advertisement

Archived

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

Bully

ACCESS VIOLATION!!!

This topic is 6578 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 getting an Access Violation error. I can''t figure what is actually causing the problem. According to the debugger this is the line which is stuffing up. pDDSPrimary->GetAttachedSurface(&ddsd.ddsCaps,&pDDSBack); Please help.... if you need more info just tell me what you need. Thanks in advance... -David

Share this post


Link to post
Share on other sites
Advertisement
Step through it with the debugger.

Is pDDSPrimary NULL?
Is ddsd (surface description) filled in?

Looks like pDDSPrimary wasn''t created..

// CHRIS

Share this post


Link to post
Share on other sites
Here is the rest of the initialization method.

        
DirectDrawCreateEx(NULL,(void**)&pDD,IID_IDirectDraw7,NULL);


hr = pDD->SetCooperativeLevel(hWnd,
DDSCL_ALLOWMODEX |
DDSCL_ALLOWREBOOT |
DDSCL_EXCLUSIVE |
DDSCL_FULLSCREEN);


pDD->SetDisplayMode(Width,Height,Bpp,0,0);

memset(&ddsd,0,sizeof(ddsd));
ddsd.dwSize = sizeof(ddsd);
ddsd.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT;

ddsd.dwBackBufferCount = 1;

ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE |
DDSCAPS_COMPLEX |
DDSCAPS_FLIP;


pDD->CreateSurface(&ddsd,&pDDsPrimary,NULL);



ddsd.ddsCaps.dwCaps = DDSCAPS_BACKBUFFER;

pDDsPrimary->GetAttachedSurface(&ddsd.ddsCaps,&pDDsBack);



Edited by - bully on July 14, 2000 1:46:51 AM

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Why did you put "(void **)" in front of the pDD?
As which type did you declare pDD?

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!