Archived

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

ACCESS VIOLATION!!!

This topic is 6366 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
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