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. path name

path name

Scheduled Pinned Locked Moved C / C++ / MFC
data-structureshelpquestion
4 Posts 4 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.
  • R Offline
    R Offline
    radhika28
    wrote on last edited by
    #1

    I want to hide the drive name during runtime.I have displayed a directory tree in a tree control.The code looks like this, CString str = ((CIFlappApp *)AfxGetApp())->m_strAppDrive; str+="\:"; str+="\\"; str+="MyFavourites"; CString str1 = str; CreateDirectory(str,NULL); str+="\\"; CString sub = str+"Online Bookmarks"; CreateDirectory(sub,NULL); sub= str+"Music"; CreateDirectory(sub,NULL); sub= str+"Pictures"; CreateDirectory(sub,NULL); sub= str+"Documents"; CreateDirectory(sub,NULL); m_bookmark.PopulateTree(str1); Now when i run the application the tree is displayed like this, D:\My Favourites Documents Music OnLine Bookmarks Pictures I want to displat the tree like this. Favourites Documents Music OnLine Bookmarks Pictures. How can i do this.Can anyone help me in this. Thanks.

    S F T 3 Replies Last reply
    0
    • R radhika28

      I want to hide the drive name during runtime.I have displayed a directory tree in a tree control.The code looks like this, CString str = ((CIFlappApp *)AfxGetApp())->m_strAppDrive; str+="\:"; str+="\\"; str+="MyFavourites"; CString str1 = str; CreateDirectory(str,NULL); str+="\\"; CString sub = str+"Online Bookmarks"; CreateDirectory(sub,NULL); sub= str+"Music"; CreateDirectory(sub,NULL); sub= str+"Pictures"; CreateDirectory(sub,NULL); sub= str+"Documents"; CreateDirectory(sub,NULL); m_bookmark.PopulateTree(str1); Now when i run the application the tree is displayed like this, D:\My Favourites Documents Music OnLine Bookmarks Pictures I want to displat the tree like this. Favourites Documents Music OnLine Bookmarks Pictures. How can i do this.Can anyone help me in this. Thanks.

      S Offline
      S Offline
      stanlymt
      wrote on last edited by
      #2

      Hi Radhika, You can use string manipulations to remove the prefix of drive letter. There are so many helpful functions in CString class.

      1 Reply Last reply
      0
      • R radhika28

        I want to hide the drive name during runtime.I have displayed a directory tree in a tree control.The code looks like this, CString str = ((CIFlappApp *)AfxGetApp())->m_strAppDrive; str+="\:"; str+="\\"; str+="MyFavourites"; CString str1 = str; CreateDirectory(str,NULL); str+="\\"; CString sub = str+"Online Bookmarks"; CreateDirectory(sub,NULL); sub= str+"Music"; CreateDirectory(sub,NULL); sub= str+"Pictures"; CreateDirectory(sub,NULL); sub= str+"Documents"; CreateDirectory(sub,NULL); m_bookmark.PopulateTree(str1); Now when i run the application the tree is displayed like this, D:\My Favourites Documents Music OnLine Bookmarks Pictures I want to displat the tree like this. Favourites Documents Music OnLine Bookmarks Pictures. How can i do this.Can anyone help me in this. Thanks.

        F Offline
        F Offline
        freeman868
        wrote on last edited by
        #3

        I add sth based on your code follow: CString drv = ((CIFlappApp *)AfxGetApp())->m_strAppDrive; drv+="\:"; drv+="\\"; CString str = drv + "MyFavourites"; CString str1 = str; CreateDirectory(str,NULL); str+="\\"; CString sub = str+"Online Bookmarks"; CreateDirectory(sub,NULL); sub= str+"Music"; CreateDirectory(sub,NULL); sub= str+"Pictures"; CreateDirectory(sub,NULL); sub= str+"Documents"; CreateDirectory(sub,NULL); str1.TrimLeft(drv); m_bookmark.PopulateTree(str1);

        freeman

        1 Reply Last reply
        0
        • R radhika28

          I want to hide the drive name during runtime.I have displayed a directory tree in a tree control.The code looks like this, CString str = ((CIFlappApp *)AfxGetApp())->m_strAppDrive; str+="\:"; str+="\\"; str+="MyFavourites"; CString str1 = str; CreateDirectory(str,NULL); str+="\\"; CString sub = str+"Online Bookmarks"; CreateDirectory(sub,NULL); sub= str+"Music"; CreateDirectory(sub,NULL); sub= str+"Pictures"; CreateDirectory(sub,NULL); sub= str+"Documents"; CreateDirectory(sub,NULL); m_bookmark.PopulateTree(str1); Now when i run the application the tree is displayed like this, D:\My Favourites Documents Music OnLine Bookmarks Pictures I want to displat the tree like this. Favourites Documents Music OnLine Bookmarks Pictures. How can i do this.Can anyone help me in this. Thanks.

          T Offline
          T Offline
          ThatsAlok
          wrote on last edited by
          #4

          radhika28 wrote:

          I want to hide the drive name during runtime.I have displayed a directory tree in a tree control.The code looks like this, CString str = ((CIFlappApp *)AfxGetApp())->m_strAppDrive; str+="\:"; str+="\\"; str+="MyFavourites"; CString str1 = str; CreateDirectory(str,NULL); str+="\\"; CString sub = str+"Online Bookmarks"; CreateDirectory(sub,NULL); sub= str+"Music"; CreateDirectory(sub,NULL); sub= str+"Pictures"; CreateDirectory(sub,NULL); sub= str+"Documents"; CreateDirectory(sub,NULL); m_bookmark.PopulateTree(str1); Now when i run the application the tree is displayed like this, D:\My Favourites Documents Music OnLine Bookmarks Pictures I want to displat the tree like this. Favourites Documents Music OnLine Bookmarks Pictures. How can i do this.Can anyone help me in this.

          could you show me piece of code , which you are using to populate item in TreeCtrl

          "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

          cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief And You

          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