title: Error in windows api program: cannot convert from 'LRESULT (__stdcall *)(HWND,UINT,LPARAM,WPARAM) to WNDPROC
body: <p>i've made a simple windows api program having the functions WinMain() and WinProc() , but i'm getting this error : </p>
  
  <pre><code> error C2440: '=' : cannot convert from 'LRESULT (__stdcall *)(HWND,UINT,LPARAM,WPARAM)'    to 'WNDPROC'
   1&gt; This conversion requires a reinterpret_cast, a C-style cast or function-style cast
  
  
    #include&lt;windows.h&gt;
  
   LRESULT CALLBACK WindowProc(HWND hWnd, UINT message, LPARAM lParam, WPARAM wParam);
  
  
   int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
   {
    WNDCLASSEX WindowClass;
  
    static LPCTSTR szAppName = L"OFWin";
    HWND hWnd;
    MSG msg;
  
    WindowClass.cbSize = sizeof(WNDCLASSEX);
  
    WindowClass.style = CS_HREDRAW | CS_VREDRAW;
    WindowClass.lpfnWndProc = WindowProc;               // error
            ....
    }
  
    LRESULT CALLBACK WindowProc(HWND hWnd, UINT message, LPARAM lParam, WPARAM wParam)
    { ..... } 
  </code></pre>
  
  <p>the program's taken word to word from my book (ivor horton's beginning visual c++ 2010), what's wrong?</p>