The last parameter (the ID) is also used as the menu handler for the window. If that value is non-NULL, the system will attempt to load the menu given in nID and attach it to the window. If you step into Create until you get here: // allow modification of several common create parameters AfxHookWindowCreate(this); HWND hWnd = ::CreateWindowEx(cs.dwExStyle, cs.lpszClass, cs.lpszName, cs.style, cs.x, cs.y, cs.cx, cs.cy, cs.hwndParent, cs.hMenu, cs.hInstance, cs.lpCreateParams); #ifdef _DEBUG if (hWnd == NULL) { TRACE1("Warning: Window creation failed: GetLastError returns 0x%8.8X\n", GetLastError()); } #endif You will see if you put a watch on "@ERR" GetLastError returns 1401, "@ERR,hr" will then show you that maps to "Invaid Menu Handle"