How to use FileChooserDialogBox?

Hello, I want to use FileChooserDialogBox

The code below compiles anyway, however I cannot make that dialogbox select a file the user chooses
So please help me with this issue

juce::FileBrowserComponent* browser = new juce::FileBrowserComponent(juce::FileBrowserComponent::canSelectFiles, juce::File(), nullptr, nullptr);

juce::FileChooserDialogBox* dialogBox = new juce::FileChooserDialogBox("Open some kind of file",
    "Please choose some kind of file that you want to open...",
    *browser,
    false,
    juce::Colours::lightgrey);

auto onFileSelected = [this](int r)
    {
        //juce::ModalComponentManager::Callback::modalStateFinished(r);

        //auto selectedFile = this->browser;
    };

dialogBox->centreWithDefaultSize(nullptr);
dialogBox->enterModalState(true, juce::ModalCallbackFunction::create(onFileSelected), false);

If you’re just trying to show a dialog so that the user can pick a file, you might have more luck with the FileChooser class. There are examples of how to use this in the JUCE repo, e.g. the DialogsDemo.

Hello, thank you for your comments
But I like the GUI of FileChooserDialogBox better
Is “FileChooserDialogBox” obsolete now?