What's wrong with this?

This is a discussion on What's wrong with this? within the Windows Programming forums, part of the Platform Specific Boards category; // Step 4: the Window Procedure LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch(msg) { case ...

  1. #1
    left crog... back when? incognito's Avatar
    Join Date
    Oct 2001
    Posts
    1,427

    What's wrong with this?


    // Step 4: the Window Procedure
    LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
    {
    switch(msg)
    {
    case WM_CLOSE:
    DestroyWindow(hwnd);
    break;

    case WM_DESTROY:
    PostQuitMessage(0);
    break;

    case WM_COMMAND:

    switch (LOWORD(wParam))

    {
    case IDABOUT:

    MessageBox(NULL, "Trying this window thing out", "Whoa",
    MB_ICONEXCLAMATION | MB_OK);

    break;
    case D_ABOUT:

    int ret = DialogBox(GetModuleHandle(NULL),
    MAKEINTRESOURCE(IDD_ABOUT), hwnd, AboutDlgProc);

    break;


    }




    break;



    default:
    return DefWindowProc(hwnd, msg, wParam, lParam);
    }
    return 0;
    }


    This is what I get.

    Error Codes:



    --------------------Configuration: Project - Win32 Debug--------------------
    Compiling resources...
    Compiling...
    main.cpp
    C:\Documents and Settings\incognito\My Documents\Win32 Project\Project\main.cpp(32) : error C2065: 'D_ABOUT' : undeclared identifier
    C:\Documents and Settings\incognito\My Documents\Win32 Project\Project\main.cpp(32) : error C2051: case expression not constant
    C:\Documents and Settings\incognito\My Documents\Win32 Project\Project\main.cpp(35) : error C2065: 'IDD_ABOUT' : undeclared identifier
    C:\Documents and Settings\incognito\My Documents\Win32 Project\Project\main.cpp(35) : error C2065: 'AboutDlgProc' : undeclared identifier
    C:\Documents and Settings\incognito\My Documents\Win32 Project\Project\main.cpp(56) : error C2373: 'AboutDlgProc' : redefinition; different type modifiers
    Error executing cl.exe.

    Project.exe - 5 error(s), 0 warning(s)



    Thanks in advance.
    There are some real morons in this world please do not become one of them, do not become a victim of moronitis. PROGRAMMING IS THE FUTURE...THE FUTURE IS NOW!!!!!!!!!

    "...The only real game I thank in the world is baseball..." --Babe Ruth

    "Life is beautiful"-Don Corleone right before he died.

    "The expert on anything was once a beginner" -Baseball poster I own.


    Left cprog on 1-3-2005. Don't know when I am coming back. Thanks to those who helped me over the years.

  2. #2
    left crog... back when? incognito's Avatar
    Join Date
    Oct 2001
    Posts
    1,427
    Never Mind got it.
    There are some real morons in this world please do not become one of them, do not become a victim of moronitis. PROGRAMMING IS THE FUTURE...THE FUTURE IS NOW!!!!!!!!!

    "...The only real game I thank in the world is baseball..." --Babe Ruth

    "Life is beautiful"-Don Corleone right before he died.

    "The expert on anything was once a beginner" -Baseball poster I own.


    Left cprog on 1-3-2005. Don't know when I am coming back. Thanks to those who helped me over the years.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 9
    Last Post: 07-15-2004, 04:30 PM
  2. Debugging-Looking in the wrong places
    By JaWiB in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 11-03-2003, 10:50 PM
  3. Confused: What is wrong with void??
    By Machewy in forum C++ Programming
    Replies: 19
    Last Post: 04-15-2003, 01:40 PM
  4. God
    By datainjector in forum A Brief History of Cprogramming.com
    Replies: 746
    Last Post: 12-22-2002, 12:01 PM
  5. Whats wrong?
    By Unregistered in forum C Programming
    Replies: 6
    Last Post: 07-14-2002, 02:04 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21