Problem with Browse for Folder

Post your tools and samples or ask for them.
FRBhote
India
Posts: 2216
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: 2924
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: 2216
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.

Dobby
Germany
Posts: 8
Joined: 24 Apr 2017, 11:52
Location: Salem Germany

Re: Problem with Browse for Folder

Post by Dobby » 27 Mar 2020, 18:46

Dave Rabelink wrote:
04 Jan 2020, 11:39

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.
Hello Dave,

a thousand thanks for all your work on these callback libraries.
I've been using them since 6.3 and I'm so glad to have them.

Since moving to TD7.3 I learned that Callback DLL 7.2 doesn't work. When Browsing for Folder, the app just crashes.

You mentioned, that you're working on a new callback dll already.
Any idea when it will arrive? It would be so great to have it back again.

best regards
Ulf

guythompson2
United States of America
Posts: 3
Joined: 19 Mar 2018, 16:42
Location: Memphis, USA

Re: Problem with Browse for Folder

Post by guythompson2 » 03 Aug 2020, 15:23

I'm also interested in the new callback dll. Is there any status on this?

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

Re: Problem with Browse for Folder

Post by Dave Rabelink » 01 Oct 2020, 09:20

Sorry for my late reply.

The overhaul of Callback is not yet finished. Need some spare time on that...

But in the meantime I have uploaded a TD73 version, based on the old code which can be used.


https://samples.tdcommunity.net/index.p ... rch_mode=f
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

Dobby
Germany
Posts: 8
Joined: 24 Apr 2017, 11:52
Location: Salem Germany

Re: Problem with Browse for Folder

Post by Dobby » 01 Oct 2020, 12:02

Hello Dave,

thank you so much for providing this file.
For my developpiing skills are quite low level I depend on generous people like you, who share their valuable knowledge.

To take my share for your efforts I would be prepared for a donation to honor your work.
Do you have a donation button somewhere?

Did I understand right that the upcoming version will be independent from the TD version?

Again, thank you. It work perfectly, like always. :-)
br
Dobby

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

Re: Problem with Browse for Folder

Post by Dave Rabelink » 01 Oct 2020, 17:05

Dobby wrote:
01 Oct 2020, 12:02
Did I understand right that the upcoming version will be independent from the TD version?
Yes. So there will be just one dll which will work in any TD version, even the future ones.
This resolves the hassle having to build a new version when a new TD version is released.
To take my share for your efforts I would be prepared for a donation to honor your work.
Do you have a donation button somewhere?
Nice!
Well, yes. There is a donate button on the side-bar of the TD Wiki main page:

https://wiki.tdcommunity.net/index.php/Main_Page
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

guythompson2
United States of America
Posts: 3
Joined: 19 Mar 2018, 16:42
Location: Memphis, USA

Re: Problem with Browse for Folder

Post by guythompson2 » 06 Oct 2020, 20:22

Thank you SO much. It works like a champ.

Return to “Tools & Samples”

Who is online

Users browsing this forum: No registered users and 0 guests