0

I am really struggling how to make a window with three selections of options. I currently have a setup that uses a CFileDialog object and have successfully implemented two dropdown menus and multiple check items.

What I want is to implement a pop up window that has the two drop down menus and the check boxes. If a certain item is selected in one of the dropdown menus then the file dialog is opened.

Currently I am trying to make a CWnd object and try to write code for it there.

    CWnd myWindow;

    BOOL VALUE = myWindow.Create(_T("DesktopApp"), _T("test"), WS_VISIBLE | WS_BORDER | WS_CAPTION,
        RECT{ 100,100,400,400 },
        myWindow.GetDesktopWindow(), 12);
    
    myWindow.ShowWindow(SW_SHOWNORMAL);
    

    if (VALUE == FALSE) {
        return 0;
    }

Every time I run this, it prematurely returns (VALUE == FALSE). Did I do something wrong? Is there a simpler way to create a window?

Ranoiaetep
  • 5,872
  • 1
  • 14
  • 39

1 Answers1

1

The first argument to CWnd::Create is the window class name. A class with the requested name must have been registered before it can be created.

It is common to register an application local class for the application's main window. MFC provides a convenient wrapper function (AfxRegisterWndClass) to register a window class.

IInspectable
  • 46,945
  • 8
  • 85
  • 181