Results 1 to 12 of 12

Thread: BrowseForFolder

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2010
    Posts
    1,297

    BrowseForFolder

    What is recommended for VB6 to use with Win 10?
    I found a number of examples via Google but not sure which is 'best' ?
    Thanks.

  2. #2
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    2,637

    Re: BrowseForFolder

    According to
    https://docs.microsoft.com/en-us/win...owseforfolderw
    you should use IFileDialog
    https://docs.microsoft.com/en-us/win...re-ifiledialog
    For Windows Vista or later, it is recommended that you use IFileDialog with the FOS_PICKFOLDERS option rather than the SHBrowseForFolder function. This uses the Open Files dialog in pick folders mode and is the preferred implementation.
    EDIT: Found this: https://www.vbforums.com/showthread....e-(TLB-Vista-)
    One System to rule them all, One IDE to find them,
    One Code to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    For health reasons i try to avoid reading unformatted Code

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2010
    Posts
    1,297

    Re: BrowseForFolder

    Thanks Zvoni will check em out. Did you try that last one ?
    Didn't work for me even though I have the reference. BstrFromPWstr not defined. Or - is it a missing olelib.tlb ? Where should the be ?
    Last edited by AlexanderBB; Sep 7th, 2021 at 03:41 AM.

  4. #4
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    4,702

    Re: BrowseForFolder

    There is also a iFileDialog class written by LaVolpe, it supports both the classis BrowseForFolder method as the new iFileDialog version.
    https://www.vbforums.com/showthread....ht=ifiledialog

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2010
    Posts
    1,297

    Re: BrowseForFolder

    I do like the LaVolpe program but it's a bit too complicated to just drop in to my stuff.
    Ha anyone got a "cut down " version or know how I might use it? I found some parts show as "hidden" and I have to use XP for my VB6 so the ref to Vista and later can't be tested.
    Although, once compiled I can run it on Win 10. Or try to.

  6. #6
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    4,702

    Re: BrowseForFolder

    Are you using XP for developing?

  7. #7

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2010
    Posts
    1,297

    Re: BrowseForFolder

    Yes I don't have VB6 for any other platform.

  8. #8
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    4,702

    Re: BrowseForFolder

    But is XP the main OS on your computer for daily use?
    VB6 can also be installed on W7, W8, W10

    You can also use this:
    https://www.vbforums.com/showthread....rowseForFolder

    Or this one:
    https://www.vbforums.com/showthread....wse-For-Folder

  9. #9

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2010
    Posts
    1,297

    Re: BrowseForFolder

    I have 2 computers, XP and Win 10. I don't know if VB6 is able to be installed on another computer. My son installed it for me ages
    and is part of "Visual Studio 6" but I only use Vb6.
    Thanks for the other links, will try them out.

  10. #10
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,449

    Re: BrowseForFolder

    there are some threads in this forum detailing how to install vb6 onto w10, as long as you have install disks, maybe bout time you upgraded
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  11. #11

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2010
    Posts
    1,297

    Re: BrowseForFolder

    I'm vert familiar with XP and prefer it's Explorer plus have a number of apps etc that work too well to change. Having both OS's lets me 'keep up' and the XP machine is not on the net.
    I don't think I have the VB6 install disks, or if I have I've no idea where.
    Should XP fall over completely then there'll be no choice.

  12. #12
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,449

    Re: BrowseForFolder

    i also prefered XP, and stayed with it for some time,
    i ended up giving up on XP when firefox kept falling over and some other problems, plus some of my VB programs did not work correctly for people who were running w10 or other later systems
    i still have my XP laptop in case and i can see a time coming where i will have to regress to it for some things that do not work in w10
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width