winapidialog

Win32 dialog is not shown when adding a custom control


I just created a simple Win32 application with the VS2022 wizard.

I opened the About box dialog resource, and I added a "Custom Control" from the Toolbox. Now, the About box is NOT shown anymore when I run the application.

Here is how the .rc file looks like:

IDD_ABOUTBOX DIALOGEX 0, 0, 170, 62
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "About win32_project"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
    ICON            IDI_WIN32PROJECT,IDC_STATIC,14,14,20,20
    LTEXT           "win32_project, Version 1.0",IDC_STATIC,42,14,114,8,SS_NOPREFIX
    LTEXT           "Copyright (c) 2023",IDC_STATIC,42,26,114,8
    DEFPUSHBUTTON   "OK",IDOK,113,41,50,14,WS_GROUP
    CONTROL         "Custom1",IDC_CUSTOM1,"",WS_TABSTOP,28,41,50,14
END

The problem seems to be related to the "Custom Control". If I remove it, the About dialog box is shown.


Solution

  • According to the IInspectable's suggestion:

    The CONTROL statement must provide a valid window class (either a name or a 16-bit value). "" is not a valid window class.