Original Post
Hey everyone,
I''ve just started programming in DirectX and I''m trying to initialize DirectDraw so I can continue on to Direct3D.
My problem is that I cannot figure out why SetCooperativeLevel isn''t being called. I''ve removed WndProc and WinMain for readability, here is my code:
/***************************************************************/
#include
#include
#include "c:\DezTools\include\ddraw.h"
#include "c:\DezTools\include\d3d.h"
// WndProc Function //
LPVOID g_pDD;
HRESULT Initialize3DEnvironment( HWND hWnd )
{
HRESULT hr;
hr = DirectDrawCreateEx( NULL, (void **)&g_pDD,
IID_IDirectDraw7, NULL );
if( FAILED( hr ) )
return hr;
/************* PROBLEM LINE ***********************/
hr = g_pDD ->SetCooperativeLevel( hWnd, DDSCL_NORMAL);
/**************************************************/
if( FAILED( hr ) )
return hr;
}
// WinMain Function //
/***************************************************************/
When I compile, the ONLY error I get is:
...error C2065: ''SetCooperativeLevel'' : undeclared identifier
Error executing cl.exe.
Learning Code.obj - 1 error(s), 0 warning(s)
I copied that line of code exactly from the SDK help file that came with DirectX 7. Now I''ll be honest, I just started Windows programming today (5 hours ago), and it is VERY possible that I made a mistake somewhere. But I''ve checked the ''ddraw.h'' source code for the ''SetCooperativeLevel'' macro, and it''s not a typing error, and I have included ''ddraw.h'' in my program (as you can see).
I can''t figure out what I''ve done wrong with this program. I''m using DirectX 7 / VC++ 4.0 If anybody could help me, I would be very greatful. Thanks.