Code:
#include "stdafx.h"
#include <ddraw.h>
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
// Initialize DirectDraw
LPDIRECTDRAW7 lpDD7;
HRESULT hr;
if (FAILED(hr = DirectDrawCreateEx(NULL, (VOID**)&lpDD7, IID_IDirectDraw7, NULL)))
return FALSE;
if (FAILED(hr = lpDD7->SetCooperativeLevel(NULL, DDSCL_NORMAL)))
return FALSE;
return 0;
}
Errors:
C:\c\DirectDrawTest2\DirectDrawTest2.cpp(13) : error C2065: 'LPDIRECTDRAW7' : undeclared identifier
C:\c\DirectDrawTest2\DirectDrawTest2.cpp(13) : error C2146: syntax error : missing ';' before identifier 'lpDD7'
C:\c\DirectDrawTest2\DirectDrawTest2.cpp(13) : error C2065: 'lpDD7' : undeclared identifier
C:\c\DirectDrawTest2\DirectDrawTest2.cpp(16) : error C2065: 'DirectDrawCreateEx' : undeclared identifier
C:\c\DirectDrawTest2\DirectDrawTest2.cpp(16) : error C2065: 'IID_IDirectDraw7' : undeclared identifier
C:\c\DirectDrawTest2\DirectDrawTest2.cpp(19) : error C2227: left of '->SetCooperativeLevel' must point to class/struct/union
Error executing cl.exe.
...help?
(Thanks so far MrWizard)