SelectFolderDialog returns Nil when "Documents", "Pictures", "Music", "Videos" selected in left pane

I posted this earlier by tagging on to an older forum thread (link text) but received no response. On the off chance that some folks didn’t bother to look at it since the old response was already checked as “Answered”, I thought maybe starting a new thread was a better idea. So, forgive me if you’ve already read this but I’m still in search of an answer. I have run into this same issue (and I’ve got to believe that others have as well) as was documented in the older thread … e.g., selecting a “virtual folder” (e.g., Documents, Pictures, Music, Video) returns Nil using the following code:

[code]Dim dlg As New SelectFolderDialog
dlg.ActionButtonCaption = “Select”
dlg.Title = “Title Property”
dlg.PromptText = “Prompt Text”
dlg.InitialDirectory = SpecialFolder.Documents

Dim f As FolderItem
f = dlg.ShowModal
If f <> Nil Then
// Use the folderitem here
Else
// User cancelled
End If[/code]

I can understand Christian’s answer regarding “virtual folders”, but where does that leave the user who doesn’t know that those “virtual folders” are not “real” folders from which they can select? I guess a better question would be, "How do I present a select folder dialog box to the user to select a folder where all the selections available in the dialog box are actually ‘selectable’ folders??? I can’t expect the user to know the difference and I’ve got to believe that this is not that unique of a problem.

Thanks in advance!
… Don

[code]Dim dlg As New SelectFolderDialog
dlg.ActionButtonCaption = “Select”
dlg.Title = “Title Property”
dlg.PromptText = “Prompt Text”
dlg.InitialDirectory = SpecialFolder.Documents

Dim f As FolderItem
f = dlg.ShowModal
If f <> Nil Then
// Use the folderitem here
msgbox f.displayname
Else
// User cancelled
End If[/code]

returns ‘Pictures’ , ‘Movies’ and ‘Music’ for me, just fine
Are you sure yours are not aliases?

Hey, Jeff … thanks for taking your time to respond. As far as I know, they are not aliases. It looks like any other standard Windows file browser dialog box (see image). If I click on “Documents” as my choice for selecting the folder, it returns Nil. If, however, I select any other folder in the right-side dialog box pane, it returns the folder info properly.

Could the difference between us be OS-related? … (I’m on Windows 7 Ultimate 64-bit)

… Don

I tried on Windows 8.1 and 10 (Both x64) and got expected folder names without error.

Sorry no Windows 7 to test on right now but it does sound like it could be related to that version

Thanks, Brian … appreciate your response. I do have a MS Surface PRO 6 w/ Windows 10 and XOJO installed that I can fire up when I get home this evening. I’ll give it a go and see if it makes any difference.

Well, well, well … it IS OS-related apparently! Trying the same code on my Surface PRO 6 with Windows 10 PRO works just fine. I guess the culprit is Windows 7 … now the question … how in the world do I work around that???

Also, if anyone else out there is using Windows 7, I’d appreciate it very much if you could try the code I posted above in this thread to see if you can replicate the problem so I know for sure that Windows 7 is indeed the source of the issue for sure.

Thanks in advance,
… Don

windows 7 - same here

Thanks, Norman! So, since you confirmed it, should I consider this a bug and file a Feedback report?

Also, any clever ideas on how to get around it?

I’d file a report and see what, if anything, Xojo can do about it

I have no idea how to work around this

Okie Dok … thanks. I thought since the Raptors won last night that the state of euphoria you were still in would lead to a mind that was overflowing with solutions of sheer profundity! OK, I’ll cut the B.S. now :smiley: … thanks again for verifying it. It’s always a good feeling to know that you’re not the only one in the world experiencing the problem … (I guess that’s a corollary to “misery loves company” :smiley: )

I dont even see an option on MSDN about customizing the dialog to hide the left navigation pane
https://docs.microsoft.com/en-us/windows/desktop/dlgbox/customizing-common-dialog-boxes

I’m not sure which of the dialog types Xojo uses (old or new)

Well, I did find this … but not sure if it helps me at all with the two options they show for “turning off the navigation pane”

link text

ah yeah tere are registry hacks but an app would require elevated privs to do that
and its not specific to your app

bad mojo basically

I’d file a bug report and see if there isnt something that can be captured and returned from the framework as it seems likely thats the right place to do that

Okie Dok … <https://xojo.com/issue/56059>

Yes, just tried this in a Win7 VM (VirtualBox under macOS). Picking a “virtual” folder gives Nil, while opening the “virtual” folder Documents in the side panel to display the contents (two folders called My Documents and Public Documents), and then picking either “My Documents” or “Public Documents” returns “Documents”.

I would have expected it to return “My Documents”.

Thanks, Tim! Appreciate your response and added info. I’m going to add that to the Feedback report I filed. I hadn’t tried what you did, but now that I do, I get the same result you did.

It baffles me why this wasn’t noticed by many more folks earlier on than this … a folder item used to select a folder is such a common programming element that you’d think it would’ve bit someone before this.