ACCESS VIOLATION!!!
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
" The fastest code is the code you don't call "
Step through it with the debugger.
Is pDDSPrimary NULL?
Is ddsd (surface description) filled in?
Looks like pDDSPrimary wasn''t created..
// CHRIS
Is pDDSPrimary NULL?
Is ddsd (surface description) filled in?
Looks like pDDSPrimary wasn''t created..
// CHRIS
// CHRIS [win32mfc]
Here is the rest of the initialization method.
Edited by - bully on July 14, 2000 1:46:51 AM
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
" The fastest code is the code you don't call "
July 14, 2000 12:56 AM
Why did you put "(void **)" in front of the pDD?
As which type did you declare pDD?
As which type did you declare pDD?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement