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. ATL / WTL / STL
  4. How do I call the choose folder dialog

How do I call the choose folder dialog

Scheduled Pinned Locked Moved ATL / WTL / STL
c++question
4 Posts 3 Posters 11 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.
  • J Offline
    J Offline
    Jose Cruz
    wrote on last edited by
    #1

    I´m trying to show the Folder dialog. Does any body knows where can I get a sample ATL/WTL project with this.

    M 1 Reply Last reply
    0
    • J Jose Cruz

      I´m trying to show the Folder dialog. Does any body knows where can I get a sample ATL/WTL project with this.

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      SHBrowseForFolder() is the API. There are wrapper classes here on CP (but I haven't looked to see which ones use ATL.) --Mike-- Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click! My really out-of-date homepage Sonork-100.19012 Acid_Helm

      J 1 Reply Last reply
      0
      • M Michael Dunn

        SHBrowseForFolder() is the API. There are wrapper classes here on CP (but I haven't looked to see which ones use ATL.) --Mike-- Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click! My really out-of-date homepage Sonork-100.19012 Acid_Helm

        J Offline
        J Offline
        Jose Cruz
        wrote on last edited by
        #3

        Yes, I have the following Function wich calls the BROWSEINFO API, but when I run this on Win98 I get an exception, but on winME everything works OK. Can somebody help me solve this problem.:confused: BOOL folderDialog(const HWND parent, const char *topic, char *result, const bool allowNew, const int extraFlags) { // CoInitialize must be called to support BIF_USENEWUI. OleInitialize(NULL); LPMALLOC pMalloc = NULL; LPITEMIDLIST pidl = NULL; BROWSEINFO bi; ZeroMemory(&bi, sizeof(BROWSEINFO)); // set the bi's default values bi.hwndOwner = parent; bi.lpszTitle = topic; bi.ulFlags = BIF_STATUSTEXT | extraFlags; if (!allowNew) { bi.ulFlags = bi.ulFlags; } pidl = SHBrowseForFolder(&bi); if(pidl != NULL) { SHGetPathFromIDList(pidl, result); // free memory if (FAILED(SHGetMalloc(&pMalloc))) { throw "SHGetMalloc Failed!"; } pMalloc->Free(pidl); pMalloc->Release(); OleUninitialize(); return (BOOL)strlen(result); } OleUninitialize(); return FALSE; }

        G 1 Reply Last reply
        0
        • J Jose Cruz

          Yes, I have the following Function wich calls the BROWSEINFO API, but when I run this on Win98 I get an exception, but on winME everything works OK. Can somebody help me solve this problem.:confused: BOOL folderDialog(const HWND parent, const char *topic, char *result, const bool allowNew, const int extraFlags) { // CoInitialize must be called to support BIF_USENEWUI. OleInitialize(NULL); LPMALLOC pMalloc = NULL; LPITEMIDLIST pidl = NULL; BROWSEINFO bi; ZeroMemory(&bi, sizeof(BROWSEINFO)); // set the bi's default values bi.hwndOwner = parent; bi.lpszTitle = topic; bi.ulFlags = BIF_STATUSTEXT | extraFlags; if (!allowNew) { bi.ulFlags = bi.ulFlags; } pidl = SHBrowseForFolder(&bi); if(pidl != NULL) { SHGetPathFromIDList(pidl, result); // free memory if (FAILED(SHGetMalloc(&pMalloc))) { throw "SHGetMalloc Failed!"; } pMalloc->Free(pidl); pMalloc->Release(); OleUninitialize(); return (BOOL)strlen(result); } OleUninitialize(); return FALSE; }

          G Offline
          G Offline
          Gary R Wheeler
          wrote on last edited by
          #4

          Check the MSDN. One or more of the functions you are calling may not be implemented by the Win98 shell. Gary R. Wheeler

          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