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. ParseDisplayName: my computer missing

ParseDisplayName: my computer missing

Scheduled Pinned Locked Moved C / C++ / MFC
questionannouncement
4 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.
  • N Offline
    N Offline
    Neha
    wrote on last edited by
    #1

    Hi I am using the following code to get the desktop contents: if (SUCCEEDED(SHGetDesktopFolder(&lpDesktopFolder))) { //strpath: has the desktop folder path. MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, (LPCTSTR)((strPath != "\\MyComputer")?strPath:""), -1, olePath, MAX_PATH); hr = lpDesktopFolder->ParseDisplayName(NULL, NULL, olePath, &chEaten, &pidl, &dwAttributes); if(hr != S_OK) { lpDesktopFolder->Release(); return; } hr = lpDesktopFolder->BindToObject(pidl, 0, IID_IShellFolder, (LPVOID *)&lpShellFolder); If I use this code I can't find *My Computer* and icons. But if I use SHGetDesktopFolder(&lpShellFolder) I can see the *My computer* in the list. Could any one please tell me where I am going wrong? Regards Neha

    D 2 Replies Last reply
    0
    • N Neha

      Hi I am using the following code to get the desktop contents: if (SUCCEEDED(SHGetDesktopFolder(&lpDesktopFolder))) { //strpath: has the desktop folder path. MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, (LPCTSTR)((strPath != "\\MyComputer")?strPath:""), -1, olePath, MAX_PATH); hr = lpDesktopFolder->ParseDisplayName(NULL, NULL, olePath, &chEaten, &pidl, &dwAttributes); if(hr != S_OK) { lpDesktopFolder->Release(); return; } hr = lpDesktopFolder->BindToObject(pidl, 0, IID_IShellFolder, (LPVOID *)&lpShellFolder); If I use this code I can't find *My Computer* and icons. But if I use SHGetDesktopFolder(&lpShellFolder) I can see the *My computer* in the list. Could any one please tell me where I am going wrong? Regards Neha

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      It would help if you gave us a hint as to what types lpDesktopFolder and lpShellFolder are.


      "When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen

      N 1 Reply Last reply
      0
      • D David Crow

        It would help if you gave us a hint as to what types lpDesktopFolder and lpShellFolder are.


        "When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen

        N Offline
        N Offline
        Neha
        wrote on last edited by
        #3

        Here is the info: LPSHELLFOLDER lpShellFolder = 0; LPSHELLFOLDER lpDesktopFolder = 0;

        1 Reply Last reply
        0
        • N Neha

          Hi I am using the following code to get the desktop contents: if (SUCCEEDED(SHGetDesktopFolder(&lpDesktopFolder))) { //strpath: has the desktop folder path. MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, (LPCTSTR)((strPath != "\\MyComputer")?strPath:""), -1, olePath, MAX_PATH); hr = lpDesktopFolder->ParseDisplayName(NULL, NULL, olePath, &chEaten, &pidl, &dwAttributes); if(hr != S_OK) { lpDesktopFolder->Release(); return; } hr = lpDesktopFolder->BindToObject(pidl, 0, IID_IShellFolder, (LPVOID *)&lpShellFolder); If I use this code I can't find *My Computer* and icons. But if I use SHGetDesktopFolder(&lpShellFolder) I can see the *My computer* in the list. Could any one please tell me where I am going wrong? Regards Neha

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          Neha wrote: Could any one please tell me where I am going wrong? If you use SHGetDesktopFolder(&lpShellFolder) and are getting the desired results, what's the problem?


          "When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen

          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