Original Post
I am trying to get DirectDraw to work but the following code keeps causing an illeagle operation error immediately at the program start.
bool Init_Graphics(HWND hwnd)
{
LPDIRECTDRAW lpdd = NULL;
LPDIRECTDRAW lpdd4 = NULL;
DirectDrawCreate(NULL, &lpdd, NULL);
lpdd->QueryInterface(IID_IDirectDraw4, (LPVOID *) &lpdd4);
lpdd->Release();
lpdd4->SetCooperativeLevel(hwnd, DDSCL_NORMAL);
lpdd4->Release();
return true;
}
I''m using the DX7 sdk, if it makes a difference.