E0167 argument of type "HWND" is incompatible with parameter of type "int"

Daniel Shepherd 246 Reputation points
2021-07-25T01:24:23.537+00:00

I am on the tutorial on winprog.org, and I am on the article "creating controls at runtime", and my code gets errors. here is my code:

case WM_CREATE:
    {
        HFONT hfDefault;
        HWND hEdit;
        hEdit = CreateWindowEx(WS_EX_CLIENTEDGE, L"EDIT", L"", WS_CHILD | WS_VISIBLE | WS_VSCROLL | ES_MULTILINE | ES_AUTOVSCROLL, 0, 0, 100, hWnd, (HMENU)IDC_MAIN_EDIT, GetModuleHandle(NULL), NULL);
    }

errors:

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,628 questions
0 comments No comments
{count} votes

Accepted answer
  1. RLWA32 45,571 Reputation points
    2021-07-25T02:34:20.17+00:00

    Review the parameters passed to the CreateWindowEx function. nf-winuser-createwindowexa
    The code posted above has omitted a required parameter for the new window's height.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.