If I was going to start debugging, I would start with lpdds. Chances are that it is not pointing to a valid surface when you're experiencing your crashes.
Good Luck!
If I was going to start debugging, I would start with lpdds. Chances are that it is not pointing to a valid surface when you're experiencing your crashes.
Good Luck!
I noticed that your calling ::ReleaseDC( hdc ) , not IDirectDrawSurface::ReleaseDC( hdc ).
If this isn't a typo, you will need to replace it with the IDirectDrawSurface::ReleaseDC version.
HTH,
-mordell
CU
------------------
Skullpture Entertainment
#40842461
Using GDI and DirectX to get around the problem of Colour space conversion I have had just pain.
One machine I got make DDraw32.dll crash a couple of times and the code works fine and on anouther I get "Invalid DC" passed back, followed by GDI.EXE and Explorer.exe dieing and having to reboot.
Here's an example of what I have coded.
if( lpdds->GetDC( &hdc ) == DD_OK )
{
if( hdc != NULL )
{
cImageClass->CopyToDC( hdc );
}
else
MessageBox( NULL, "Invalid DC", "FATAL ERROR", MB_OK );
ReleaseDC( hdc );
}
else
MessageBox( NULL, "Unable to obtain HDC", "ERROR", MB_OK );
The odd thing is that GetDC returned DD_OK when it fails?
Hope someone can help.