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 development | Windows API - Win32
0 comments No comments
{count} votes

Answer accepted by question author
  1. RLWA32 50,836 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' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.