Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. BrowseFolders Dialog on Win2k/IE5?

BrowseFolders Dialog on Win2k/IE5?

Scheduled Pinned Locked Moved C / C++ / MFC
linuxhelptutorialquestion
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    Ingmar3
    wrote on last edited by
    #1

    Hello, I've got a class to browse folders similiar to CSXBrowseFolder here on code-project. It worked fine until I needed to run my software on a fresh installed Windows 2000 with IE5. Selecting e.g. "My Documents" gives me not the real path but an Id like "::{xxxxxxxxx}". I'm not sure if I'm right, but I think I need to resolve this "link" using the shell functions. But whatever I tried it didn't work. If I select a usual folder (e.g. c:\test) it works like expected. I found a message on MSDN, that win2k/ie5 doesn't follow these links. But newer versions do so. Seems I get the Id of the not real existing folder, while IE6 resolves these links automatically. Maybe someone can give me hint how to solve this problem? Thanks in advance! Ingmar

    P 1 Reply Last reply
    0
    • I Ingmar3

      Hello, I've got a class to browse folders similiar to CSXBrowseFolder here on code-project. It worked fine until I needed to run my software on a fresh installed Windows 2000 with IE5. Selecting e.g. "My Documents" gives me not the real path but an Id like "::{xxxxxxxxx}". I'm not sure if I'm right, but I think I need to resolve this "link" using the shell functions. But whatever I tried it didn't work. If I select a usual folder (e.g. c:\test) it works like expected. I found a message on MSDN, that win2k/ie5 doesn't follow these links. But newer versions do so. Seems I get the Id of the not real existing folder, while IE6 resolves these links automatically. Maybe someone can give me hint how to solve this problem? Thanks in advance! Ingmar

      P Offline
      P Offline
      Peter Ritchie
      wrote on last edited by
      #2

      You can convert the file object's display name into a path with the following:

      /// <summary>
      /// Sample that converts a textual file/folder object display name
      /// (::{GUID} format) to a physical path (if possible)
      /// </summary>
      /// <author> Peter A. Ritchie</author>
      /// <date type="creation">26-Apr-2005</date>

      CComPtr<IShellFolder> pshf = NULL**;**

      ::SHGetDesktopFolder**(&pshf)****;**
      LPITEMIDLIST pidlDocFiles**;**
      ULONG cbEaten**;**
      pshf->ParseDisplayName**(NULL,**

      NULL**,** 
      L"::{450d8fba-ad25-11d0-98a8-0800361b1103}"**,** 
      &cbEaten**,** 
      &pidlDocFiles**,** 
      NULL**)****;**
      

      TCHAR szPath**[MAX_PATH]** = _T**("")****;**

      ::SHGetPathFromIDList**(pidlDocFiles,** szPath**)****;**

      But, I'm curious, how are you getting the display name "::{GUID}"? Are you using SHBrowseForFolder? If so, what are you doing with the PIDL? PeterRitchie.com

      I 1 Reply Last reply
      0
      • P Peter Ritchie

        You can convert the file object's display name into a path with the following:

        /// <summary>
        /// Sample that converts a textual file/folder object display name
        /// (::{GUID} format) to a physical path (if possible)
        /// </summary>
        /// <author> Peter A. Ritchie</author>
        /// <date type="creation">26-Apr-2005</date>

        CComPtr<IShellFolder> pshf = NULL**;**

        ::SHGetDesktopFolder**(&pshf)****;**
        LPITEMIDLIST pidlDocFiles**;**
        ULONG cbEaten**;**
        pshf->ParseDisplayName**(NULL,**

        NULL**,** 
        L"::{450d8fba-ad25-11d0-98a8-0800361b1103}"**,** 
        &cbEaten**,** 
        &pidlDocFiles**,** 
        NULL**)****;**
        

        TCHAR szPath**[MAX_PATH]** = _T**("")****;**

        ::SHGetPathFromIDList**(pidlDocFiles,** szPath**)****;**

        But, I'm curious, how are you getting the display name "::{GUID}"? Are you using SHBrowseForFolder? If so, what are you doing with the PIDL? PeterRitchie.com

        I Offline
        I Offline
        Ingmar3
        wrote on last edited by
        #3

        Thanks for the help. I tried it out, but if gives me the same GUID back again I put in?! For your question, I use itemIDList = SHBrowseForFolder(&browseInfo); ...do some checks and then SHGetPathFromIDList(itemIDList, szPathBuffer); And at this point I've got that GUID in szPathBuffer. I found so many samples, everyone does it that way, but I already tested on 2 win2k machines and it doesn't work. (Except I update to IE6, but this is currently not an option). Maybe something is wrong with my browseinfo structure? I did nothing special, maybe some flags are needed I didn't set? Ingmar

        P 1 Reply Last reply
        0
        • I Ingmar3

          Thanks for the help. I tried it out, but if gives me the same GUID back again I put in?! For your question, I use itemIDList = SHBrowseForFolder(&browseInfo); ...do some checks and then SHGetPathFromIDList(itemIDList, szPathBuffer); And at this point I've got that GUID in szPathBuffer. I found so many samples, everyone does it that way, but I already tested on 2 win2k machines and it doesn't work. (Except I update to IE6, but this is currently not an option). Maybe something is wrong with my browseinfo structure? I did nothing special, maybe some flags are needed I didn't set? Ingmar

          P Offline
          P Offline
          Peter Ritchie
          wrote on last edited by
          #4

          Then you've got a GUID to a virtual folder that does not have a physical location for it. PeterRitchie.com

          I 1 Reply Last reply
          0
          • P Peter Ritchie

            Then you've got a GUID to a virtual folder that does not have a physical location for it. PeterRitchie.com

            I Offline
            I Offline
            Ingmar3
            wrote on last edited by
            #5

            I tested some things, and it seems the problem isn't SHBrowseForFolder itself. But it's more strange: A simple BrowseForFolder-application works well on 2k, but my real application doesn't! I did try and error and I found out, that I get a good path, when I run SHBroswForFolder before I open a database via ODBC (CDatabase) ?!?! Don't have a good idea now, but it has definitly to do with the DB-Open. Maybe it's a bug? This works great on XP or better on any machine with IE>5. Ingmar

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups