FileChooser::browseForDirectory() produces compiler warnings 'element not found' etc


#1

In troubleshooting another problem, I’ve been systematically testing out a few lines of code at a time in one of my JUCE applications. I’ve discovered a slew of compiler warnings appear after invoking the FileChooser::browseForDirectory() method. This is using MS VS 2017 with JUCE 5.3.2.

Here is my test code:

// Set the default working directory to the current executable parent folder
defaultWDIR =
	File::getSpecialLocation(
		File::SpecialLocationType::currentExecutableFile).getParentDirectory();

// Prompt the user to accept or override the default working directory
FileChooser chooser("Choose the instrument folder", defaultWDIR);

if (chooser.browseForDirectory())
{
	// empty for test purposes...
}

If I bypass the browseForDirectory() code block, the warnings all go away.

The compiler output (release build) looks similar to what I’ve pasted here below. Several duplicates of each warning. I’ve ensured that the user has permissions to the selected folder and that the files inside are not set to read only.

'AsiSampleLibrarian2.exe' (Win32): Unloaded 'C:\Windows\System32\ResourcePolicyClient.dll'
Exception thrown at 0x00007FFC75E6A388 (KernelBase.dll) in AsiSampleLibrarian2.exe: 0x000006BA: The RPC server is unavailable.

internal\onecoreuapshell\private\inc\cloudfiletelemetry.h(98)\windows.storage.dll!00007FFC7584B363: (caller: 00007FFC7584B148) ReturnHr(1) tid(7a8) 80070490 Element not found.

shell\shell32\syncrootmanager.cpp(2751)\SHELL32.dll!00007FFC76A3AF6B: (caller: 00007FFC76A3E810) ReturnHr(1) tid(7a8) 80070490 Element not found.

internal\sdk\inc\wil\ResultMacros.h(5663)\windows.storage.dll!00007FFC7584CCCA: (caller: 00007FFC7584D2AA) ReturnHr(2) tid(7a8) 80070490 Element not found.

onecoreuap\shell\windows.storage\fileenum.cpp(216)\windows.storage.dll!00007FFC75839C27: (caller: 00007FFC75839A78) ReturnHr(6) tid(7a8) 80070005 Access is denied.

Please note that the code actually does what it’s supposed to when executed. I’m just taking a close look at all warnings now, due to an unrelated problem. If anyone can explain the warnings, please let me know.

Thanks!


#2

These are not warnings from the compiler, but debug messages from the Windows SDK (most likely from MFC). It seems that these messages were added by accident by some Microsoft developer, and they are annoying quite a lot of people for several months:


#3

Thanks for confirming that I can safely ignore these messages! From the looks of things on those forums, a fix is not likely to emerge anytime soon…