Use IShellFolder::ParseDisplayName to convert your folder string to a
PIDL:
http://msdn.microsoft.com/en-us/library/bb775090.aspx
Richard.
http://www.rtrussell.co.uk/
To reply by email change 'news' to my forename.
Or ILCreateFromPath:
http://msdn.microsoft.com/en-us/library/dd378420.aspx
Timo
--
www.TimoSoft-Software.de - Unicode controls for VB6
"Those who sacrifice freedom for safety deserve neither."
"Demokratie ist per Definition unsicher. Ihr Schutz entsteht aus der
Überzeugung, dass die demokratischen Kräfte überwiegen und sich – auf
demokratischem Wege – durchsetzen."
I would like the dialog to open at a selected folder, but also be able to
move higher up instead of only down.
If you are asking how to set the initial folder in the browser, here's how:
http://www.codeproject.com/KB/winsdk/Win32TipsAndTricks.aspx#browse1
Basically you send it BFFM_SETSELECTION from inside the callback function.
Ivo
> I can't figure out how to get the string of a folder location into
> pidlRoot of a BROWSEINFO structure for SHBrowseForFolder().
Use SHGetDesktopFolder() to get the top-level IShellFolder interface for the
Desktop namespace, then pass the string to its ParseDisplayName() method.
--
Remy Lebeau (TeamB)
> However, the problem I have now is that if I set a subdirectory,
> it will not allow me to choose any folders above it.
That is what pidlRoot is supposed to do. It is the "root" of the dialog.
You can only select items underneath the "root" folder.
> I would like the dialog to open at a selected folder, but also be able
> to move higher up instead of only down.
Then you need to set the pidlRoot to something higher up the hierarchy (such
as the PIDL for the CSIDL_DRIVES folder), and then use a callback function
(specified in the BROWSEINFO.lpfn member) to send a BFFM_SETSELECTION
message to the dialog when the callback receives the BFFM_INITIALIZED
notification.
--
Remy Lebeau (TeamB)