it jus kills it, i had to EndTask to get out of it, thanks for helpin the new guy.

DirectDraw's error codes can be helpful.
LPDIRECT3D2 lpd3d;
LPDIRECT3DDEVICE2 lpd3ddevice;
LPDIRECTDRAW lpdd = NULL;
LPDIRECTDRAWSURFACE lpddsprimary = NULL;
LPDIRECTDRAWSURFACE lpddsbackbuffer = NULL;
LPDIRECTDRAWPALETTE lpddpal = NULL;
PALETTEENTRY color_palette[256];
DDSURFACEDESC ddsd;
DDSCAPS ddscaps;
HRESULT ddrval;
HWND main_window_handle=NULL;
int hardware;
int DD_Init(HWND hwnd)
{
// this function is responsible for initializing direct draw, it creates a
// primary surface
int index; // looping index
// now that the windows portion is complete, start up direct draw
if (DirectDrawCreate(NULL,&lpdd,NULL)!=DD_OK)
{
// shutdown any other dd objects and kill window
DD_Shutdown();
return(0);
} // end if
// now set the coop level to exclusive and set for full screen and mode x
if (lpdd->SetCooperativeLevel(hwnd, DDSCL_ALLOWREBOOT | DDSCL_EXCLUSIVE |
DDSCL_FULLSCREEN | DDSCL_ALLOWMODEX)!=DD_OK)
{
// shutdown any other dd objects and kill window
DD_Shutdown();
return(0);
} // end if
// now set the display mode
if (lpdd->SetDisplayMode(SCREEN_WIDTH,SCREEN_HEIGHT,SCREEN_BPP)!=DD_OK)
{
// shutdown any other dd objects and kill window
DD_Shutdown();
return(0);
} // end if
// Create the primary surface
ZeroMemory(&ddsd, sizeof(ddsd));
ddsd.dwSize = sizeof(ddsd);
ddsd.dwFlags = DDSD_CAPS;
ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
if (lpdd->CreateSurface(&ddsd,&lpddsprimary,NULL)!=DD_OK)
{
// shutdown any other dd objects and kill window
DD_Shutdown();
return(0);
} // end if
ZeroMemory(&ddsd, sizeof(ddsd));
ddsd.dwSize = sizeof(ddsd);
ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT;
ddsd.dwWidth = SCREEN_WIDTH;
ddsd.dwHeight = SCREEN_HEIGHT;
hardware=1; //Forse Hardware Acceleration
if (hardware)
ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY;
else
ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE | DDSCAPS_SYSTEMMEMORY;
if (lpdd->CreateSurface(&ddsd, &lpddsbackbuffer,NULL) != DD_OK) return(0);
if (lpddsprimary->AddAttachedSurface(lpddsbackbuffer) != DD_OK) return(0);
//Query the hardware
if (lpd3d->QueryInterface(IID_IDirect3D2, (LPVOID *)&lpd3d) != S_OK)
return (0);
// Create the D3D device
if (lpd3d->CreateDevice(IID_IDirect3DHALDevice, lpddsbackbuffer, &lpd3ddevice) != D3D_OK)
return FALSE;
// return success if we got this far
return(1);
} // end DD_Init
---------------------------------
Thank yo so much
also, sorry for the length
I dont really know whats wrong but it cant get past the Query Interface, also I am forcing hardware acceleration (I THINK) jus to make it easier,
Thanks again,