#include <JuceHeader.h>
using namespace std;
int main (int argc, char* argv[])
{
cout << "juce test";
juce::FileChooser chooser("Select a Wave file",
{},
"*.wav");
//juce::MessageManagerLock mmLock (); //[1]
//juce::MessageManagerLock mmLock (juce::Thread::getCurrentThread()); //[2]
if (chooser.browseForFileToOpen()){}
return 0;
}
I wrote the above code to open windows file explorer in console,
The code above gives the error JUCE_ASSERT_MESSAGE_MANAGER_IS_LOCKED.
So I looked up the MessageManagerLock documentation, and added the code [1]. Then I get the jassertfalse error.
Next, I replaced code[1] with code[2] knowing that the thread address was missing, but I still get the error.
From the related documentation, I know that I can’t get the address from the main thread, so I’m browsing the documentation to create a new thread.
However, it is questionable whether this method is a fundamental solution to the problem.
What should I do to solve this problem?
Is it impossible to open windows explorer from console in the first place?
p.s. Since English is not my native language, I am asking a question by translating it with Google Translator.