Thread: Windows Programming

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Dec 2012
    Posts
    6

    Question Windows Programming

    I only have one error in my code and I dont know why it is wrong!
    (I have not run the code, but the part that is underlined in red sais:
    A value of type "long" cannot be used to initialize an entitity of type "HWND")
    All i am trying to do is create a window.

    Here is the part with the error. Its where I create a window.

    Code:
    HWND WINAPI CreateWindowEx(
            WS_EX_CLIENTEDGE,
            g_szClassName,
            "The title of my window",
            WS_OVERLAPPEDWINDOW,
            CW_USEDEFAULT, CW_USEDEFAULT, 240, 120,
            NULL, NULL, hInstance, NULL);
    
    
        if(hwnd == NULL)
        {
            MessageBox(NULL, "Window Creation Failed!", "Error!",
                MB_ICONEXCLAMATION | MB_OK);
            return 0;
        }
    
    
        ShowWindow(hwnd, nCmdShow);
        UpdateWindow(hwnd);
    How do I fix this?
    Last edited by Hazique35; 12-30-2012 at 08:48 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Differences between Windows XP and Windows Vista programming
    By nathan3011 in forum Windows Programming
    Replies: 3
    Last Post: 01-15-2009, 10:05 AM
  2. Windows 98/2000 programming in Windows XP
    By Bill83 in forum Windows Programming
    Replies: 3
    Last Post: 07-22-2005, 02:16 PM
  3. so THIS is how Windows programming in C++ goes
    By Brain Cell in forum Windows Programming
    Replies: 12
    Last Post: 06-28-2005, 12:21 PM
  4. Programming Windows API in C++
    By JoshR in forum C++ Programming
    Replies: 5
    Last Post: 03-29-2005, 05:40 AM
  5. programming in Windows
    By Draco in forum C Programming
    Replies: 9
    Last Post: 07-15-2002, 10:48 PM