在stdafx.h中定义如下:
#include <afxwin.h>
#include <mmsystem.h>
#include <mmreg.h>
#pragma comment(lib,"winmm.lib")
#include <ddraw.h>
#pragma comment(lib,"ddraw.lib")
//DirectInput
#include <dinput.h>
#pragma comment(lib,"dinput.lib")
//DirectSound
#include <dsound.h>
#pragma comment(lib,"dsound.lib")//DirectXGUI
#pragma comment(lib,"dxguid.lib")
在frame.cpp中定义如下:
#define DIRECTINPUT_VERSION 0x0700
#include "stdafx.h"#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endifIMPLEMENT_DYNCREATE(canvasFrame, CFrameWnd)// DirectDraw 
LPDIRECTDRAW7              DD;  
LPDIRECTDRAWSURFACE7       DDSur; 
LPDIRECTDRAWSURFACE7       DDBuf; 
LPDIRECTDRAWSURFACE7    DDPla[10];
DDSCAPS2    DDcaps;
DDSURFACEDESC2             DDde;
HRESULT    result;
DDCOLORKEY                 key;出现错误如下:
error C2146: syntax error : missing ';' before identifier 'DD'
error C2501: 'LPDIRECTDRAW7' : missing storage-class or type specifiers
fatal error C1004: unexpected end of file found
Error executing cl.exe.
请大虾们帮帮忙!谢谢!