Problem with Browse for Folder

Post your tools and samples or ask for them.
FRBhote
India
Posts: 2202
Joined: 09 Mar 2017, 05:32
Location: Hyderabad, India

Problem with Browse for Folder

Post by FRBhote » 04 Jan 2020, 07:43

I don't remember where I got this from - but I am grateful for it.

However, I face difficulty with it not selecting the Initial folder.

Where am I going wrong?
You do not have the required permissions to view the files attached to this post.

Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 2837
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

Re: Problem with Browse for Folder

Post by Dave Rabelink » 04 Jan 2020, 11:39

I think this comes from SalExtension.

Well, out of the box in TD, the feature to preselect a folder in the SHBrowseForFolder dialog is not supported.
This is because the API SHBrowseForFolder function implements a callback functionality to get the folder to be preselected.
And callbacks are not possible in TD without extra help.

See

BFFCALLBACK function pointer


The only way in TD to add support for callbacks is using the Callback library:

Callback archive


I'm using callback for most of my projects because I need those Windows API's.
This feature should in fact be part of the TD runtime by default in my opinion. A few libraries should be part of any project out-of-the-box. I name here: mtable, callback and subclasser.

It just happens that I'm currently busy changing the callback library so it does not need to be rebuild for each TD version separately.
When I'm finished with that and release it I will create a sample and post it here to be used with SHBrowseForFolder.

You could also use the sample provided in the old callback archive (callback2006.zip, callback2007.zip) which shows how to implement SHBrowseForFolder.
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

FRBhote
India
Posts: 2202
Joined: 09 Mar 2017, 05:32
Location: Hyderabad, India

Re: Problem with Browse for Folder

Post by FRBhote » 06 Jan 2020, 05:06

Thanks! Let me try.

Return to “Tools & Samples”

Who is online

Users browsing this forum: [Ccbot] and 0 guests