   I got direct draw in a window to complie,but I get a Link error!!!!!
#include <ddraw.h>#include <windows.h>////////////// #defines#ifndef  WIN32_LEAN_AND_MEAN // This cleans out rarely used stuff#define  WIN32_LEAN_AND_MEAN#endif#define  MAX_LOADSTRING  100 ///////////////////// Global VariablesHINSTANCE hInst;// the InstanceTCHARszWindowClass[] = "I'M A TITLE!!!" ;// Title Bar//////////////////////////////////////////////////// Prototypes: beforehand declaration of functionsATOM MyRegisterClass(HINSTANCE hInstance);BOOL InitInstance(HINSTANCE, int);LRESULT CALLBACK    WndProc(HWND, UINT, WPARAM, LPARAM);///////////////////////////////////////// WinMain() is what applies everthingint APIENTRY WinMain(HINSTANCE hInstance,  HINSTANCE hPrevInstance,  LPSTR lpCmdLine,  int nCmdShow){   MSG msg;   /////////////////////////   // Set up the windows class   MyRegisterClass(hInstance);   /////////////////////////   // Create the window. If it doesn't work, return FALSE.   if (!InitInstance (hInstance, nCmdShow))  return FALSE;   ////////////////////////   // This is a good place to use accelerations and whatnot,   // you should load them in the program from the resources (the whatever.rc)   ////////////////////////   ////////////////////////   // The main message loop is run under here,   // it pretty much explains itself. It just gets and handelse messages.   while (GetMessage(&msg, NULL, 0, 0))    { if (!TranslateAccelerator(msg.hwnd, 0, &msg))  {    TranslateMessage(&msg;    DispatchMessage(&msg; }   }   return msg.wParam;}/////////////////////// the function MyRegisterClass()// this is used to create a WIN32 application,// if you have Microsoft Visual C++ and the documentation// it explains this really well. All the wc.xxxxxxx are variables in the// WNDCLASSEX structure, it took me a while to figure it out, just look at // help files and tutorials, it's easier then it seems.ATOM MyRegisterClass(HINSTANCE hInstance){   //////////////   // This allows you to use the structure   // WNDCLASSEX as wc.whatevervariable   WNDCLASSEX wc ;   wc.cbSize    = sizeof(WNDCLASSEX) ;   //////////////   // Class Style described here.   wc.style   = CS_HREDRAW | CS_VREDRAW ;   //////////////   // This is the functions that is called when a message is sent to the window (like a PAINT msg).   wc.lpfnWndProc   = (WNDPROC)WndProc ;   ///////////////   // This is a simple window, so this isn't needed.   wc.cbClsExtra   = 0 ;   ///////////////   // Same as above   wc.cbWndExtra   = 0 ;   ///////////////   // The instance of the window.   wc.hInstance   = hInstance ;   ///////////////   // A declaration of the icon, in the resources, or from file, but   // this one is from the resources.   wc.hIcon   = 0 ;   ///////////////   // Loads the pointer, or cursor your window application will use   wc.hCursor   = 0 ;   ///////////////   // The background color can change through color_window+whatever   wc.hbrBackground    = (HBRUSH)(COLOR_WINDOW+1) ;   ///////////////   // Name of the menu system, but we don't have a menu here   // because this is a simple window.   wc.lpszMenuName    = 0 ;   ///////////////   // The title of the used windows classes, or   // the title of the program.   wc.lpszClassName    = szWindowClass ;   ///////////////   // This is the small icon, like when your windows options is to list all the   // icons, then it will display the small icons, this is the declaration of the    // icon used for this occasion   wc.hIconSm   = 0 ;   ///////////////   // This returns a registered structure,   // which is the windows classes, to the window.   return RegisterClassEx(&wc) ;}/////////////////////// the function InitInstance(HANDLE, int)// creates the main window or parent window, and // describes the style (such as WS_OVERLAPPEDWINDOW, WS means // Windows Style) and many other characteristics of the // Parent Window.BOOL InitInstance(HINSTANCE hInstance, int nCmdShow){   HWND hWnd ;   hInst = hInstance ;    // Store instance handle on global hInst   hWnd = CreateWindow( szWindowClass,    0,WS_OVERLAPPEDWINDOW,    CW_USEDEFAULT,    0,CW_USEDEFAULT,0,0,0,hInstance,0) ;   /////////////////////////   // If the window isn't made right   // it won't work...   if (!hWnd)   { return FALSE ;   }   //////////////////////////   // expains itself, nCmdShow    // means that its a small window   // not maximized   ShowWindow(hWnd, nCmdShow) ;   UpdateWindow(hWnd) ;   return TRUE ;}////////////////////////////////////////////////////// The function WndProc(HWND, unsigned, WORD, LONG)// processes the window, it does whatever you want // the window to do.//// WndProc()'s purpose is processing messages for the main window.//// ********************* BELOW ************************// //// case**WM_MESSAGE    - Use the keyboard for the exiting the program,// I set it up as ESCAPE Exits the program (or VK_ESCAPE does).// // case**WM_PAINT   - Paints the main window, you can blit bitmaps// and such, but this is a simple window, so I painted it like// that//// case**WM_DESTROY    - Destroys the window when you push// the X on the upper right of the window////////////////////////////////////////////////////LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam){   PAINTSTRUCT ps;   HDC   hdc;  LoadString(hInst, 0, 0, MAX_LOADSTRING) ;   //////////////////////////   // This is a nice simple loop   // that lets you input and get   // output to and from the window   switch (message)    { case WM_KEYDOWN:    switch(wParam)    {  case VK_ESCAPE:PostQuitMessage(0) ;break ;    } case WM_PAINT:    hdc = BeginPaint(hWnd, &ps) ;    RECT rt ;    GetClientRect(hWnd, &rt) ;    EndPaint(hWnd, &ps) ;    break ; case WM_DESTROY:    PostQuitMessage(1) ;    break ; default:    return DefWindowProc(hWnd, message, wParam, lParam) ;   }   ////////////////////////////////   // Return so it doesn't complain   return 0 ;}    // globals (ugh)LPDIRECTDRAW lpDD; // DirectDraw object defined in DDRAW.H/* * Function to initialize DirectDraw * Demonstrates: *   1) Creating the Direct Draw Object *   2) Setting the Cooperative level *   3) Setting the Display mode * */bool DirectDrawInit(HWND hwnd){    HRESULT ddrval;   /*    * Create the main DirectDraw object.    *    * This function takes care of initializing COM and Constructing    * the DirectDraw object.    */    ddrval = DirectDrawCreate( NULL, &lpDD, NULL );    if( ddrval != DD_OK )    {   return(false);    }   /*    * The cooperative level determines how much control we have over the    * screen. This must at least be either DDSCL_EXCLUSIVE or DDSCL_NORMAL    *    * DDSCL_EXCLUSIVE allows us to change video modes, and requires    * the DDSCL_FULLSCREEN flag, which will cause the window to take over    * the fullscreen. This is the preferred DirectDraw mode because it allows    * us to have control of the whole screen without regard for GDI.    *    * DDSCL_NORMAL is used to allow the DirectDraw app to run windowed.    */    ddrval = lpDD->SetCooperativeLevel( hwnd, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN );    if( ddrval != DD_OK )    {   lpDD->Release();   return(false);    return(true);}}errors:bounc'e ball fatal error LNK1120: 1 unresolved externalsbounc'e ball error LNK2019: unresolved external symbol _DirectDrawCreate@12 referenced in function "bool __cdecl DirectDrawInit(struct HWND__ *)" (?DirectDrawInit@@YA_NPAUHWND__@@@Z)help!!!!!!!![edited by - MPG on February 15, 2004 12:21:35 PM]
  Include ddraw.lib in your project. ;  It said cannot open;I"ve tried "" & <>. ;  #pragma comment(lib, "ddraw.lib") 