title: cannot convert from 'LRESULT (__stdcall *)(HWND,const wchar_t,WPARAM,LPARAM)' to 'WNDPROC'
body: <h2>Error:</h2>
  
  <p>I was running through <a href="http://www.directxtutorial.com/Lesson.aspx?lessonid=11-1-3" rel="nofollow">this</a> tutorial on window creation, and have come across the error:</p>
  
  <pre><code>Error 1 error C2440: '=' : cannot convert from 'LRESULT (__stdcall *)(HWND,const wchar_t,WPARAM,LPARAM)' to 'WNDPROC'
  </code></pre>
  
  <h2>Question:</h2>
  
  <p>What going wrong here? Is this tutorial outdated or something of the sort?</p>
  
  <h2>Code:</h2>
  
  <p>The code is identical or nearly identical to that of the tutorial.</p>
  
  <pre><code>#include "windows.h"
  #include "windowsx.h"
  
  LRESULT CALLBACK WindowProc(HWND hWnd,
                              const wchar_t message,
                              WPARAM wParam,
                              LPARAM lParam);
  
  int WINAPI WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR lpCmdLine,
                     int nCmdShow)
  {
      //Handle for the window, filled by a function
      HWND hWnd;
  
      //This struct holds information for the window class
      WNDCLASSEX wc;
  
      //Clear out the window class 
      ZeroMemory(&amp;wc, sizeof(WNDCLASSEX));
  
      //Fill struct with needed information
      wc.cbSize = sizeof(WNDCLASSEX);
      wc.style = CS_HREDRAW | CS_VREDRAW;
      wc.lpfnWndProc = WindowProc;
      wc.hInstance = hInstance;
      wc.hCursor = LoadCursor(NULL, IDC_ARROW);
      wc.hbrBackground = (HBRUSH)COLOR_WINDOW;
      wc.lpszClassName = "Window Class";
  
      //Register the window class
      RegisterClassEx(&amp;wc);
  
      //Create the window to use as a handle
      hWnd = CreateWindowEx(  NULL,
                              "Window Class",
                              "Our first window",
                              WS_OVERLAPPEDWINDOW,
                              300,
                              300,
                              500,
                              400,
                              NULL,
                              NULL,
                              hInstance,
                              NULL);
  
      ShowWindow( hWnd,
                  nCmdShow);
  
      MSG msg;
  
      while(GetMessage(&amp;msg, NULL, 0, 0))
      {
          TranslateMessage(&amp;msg);
          DispatchMessage(&amp;msg);
      }
  
      return msg.wParam;
  }
  
  //Main message handler
  static LRESULT CALLBACK WindowProc(HWND hWnd,
                              const wchar_t message,
                              WPARAM wParam,
                              LPARAM lParam)
  {
      //Find the code to run for the message
      switch(message)
      {
      case WM_DESTROY:
          {
              //Close the app entirely
              PostQuitMessage(0);
              return 0;
          } break;
      }
  
      //Handle any messages the switch didn't
      return DefWindowProc (hWnd, message, wParam, lParam);
  }
  </code></pre>