CodeGuru Forums -
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic Newsletters VB Forums Developer.com


Newest CodeGuru.com Articles:

  • Deploying Windows Server 2008 with System Center
  • Remote Desktop Protocol Performance Improvements in Windows Server 2008 R2 and Windows 7
  • The Microsoft Dynamics CRM Security Model
  • SQL Server Modeling Services with Microsoft Visual Studio 2010 Beta 2

  • Search CodeGuru:
     



    Go Back   CodeGuru Forums > Visual C++ & C++ Programming > Visual C++ Programming
    FAQ Members List Calendar Search Today's Posts Mark Forums Read

    Visual C++ Programming Ask questions about Windows programming with Visual C++ and help others by answering their questions.

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1    
    Old November 3rd, 2009, 07:51 AM
    vjshankwar vjshankwar is offline
    Member
     
    Join Date: Jan 2008
    Location: India
    Posts: 496
    vjshankwar is on a distinguished road (10+)
    How can add path of all files to List Ctrl those are present in folder ?

    HI all,

    i want to add all files of a folder ,but there is a requirement the selected folder not have any other folder only filese are must be present.

    so please tell me How can add path of all files to List Ctrl those are present in folder ?

    thanks in advance.
    __________________
    IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
    Reply With Quote
      #2    
    Old November 3rd, 2009, 08:46 AM
    VictorN's Avatar
    VictorN VictorN is offline
    Elite Member
    Power Poster
     
    Join Date: Jan 2003
    Location: Wallisellen (Zürich), Switzerland
    Posts: 10,221
    VictorN has a reputation beyond repute (3000+) VictorN has a reputation beyond repute (3000+) VictorN has a reputation beyond repute (3000+) VictorN has a reputation beyond repute (3000+) VictorN has a reputation beyond repute (3000+) VictorN has a reputation beyond repute (3000+) VictorN has a reputation beyond repute (3000+) VictorN has a reputation beyond repute (3000+) VictorN has a reputation beyond repute (3000+) VictorN has a reputation beyond repute (3000+) VictorN has a reputation beyond repute (3000+)
    Re: How can add path of all files to List Ctrl those are present in folder ?

    Well, your question is (as usual ) very unclear!
    What is your problem:
    to add an item to the list control - then use CListCtrl::InsertItem/SetItem/SetItemText,
    or
    to enumerate (to find) all the files within a folder - then use CFileFind class,
    or something else?
    __________________
    Victor Nijegorodov
    Reply With Quote
      #3    
    Old November 3rd, 2009, 10:43 AM
    vjshankwar vjshankwar is offline
    Member
     
    Join Date: Jan 2008
    Location: India
    Posts: 496
    vjshankwar is on a distinguished road (10+)
    Re: How can add path of all files to List Ctrl those are present in folder ?

    When browse for folder use, i want the ok button enable only when the folder haven't any other sub folder.

    so please tell me how can i do this.
    __________________
    IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
    Reply With Quote
      #4    
    Old November 3rd, 2009, 10:55 AM
    Arjay's Avatar
    Arjay Arjay is offline
    Moderator / MS MVP
    Power Poster
     
    Join Date: Aug 2004
    Posts: 6,914
    Arjay has a reputation beyond repute (3000+) Arjay has a reputation beyond repute (3000+) Arjay has a reputation beyond repute (3000+) Arjay has a reputation beyond repute (3000+) Arjay has a reputation beyond repute (3000+) Arjay has a reputation beyond repute (3000+) Arjay has a reputation beyond repute (3000+) Arjay has a reputation beyond repute (3000+) Arjay has a reputation beyond repute (3000+) Arjay has a reputation beyond repute (3000+) Arjay has a reputation beyond repute (3000+)
    Re: How can add path of all files to List Ctrl those are present in folder ?

    Handle the select change message and query the selected item for any child nodes. If there aren't any, enable the OK button.
    Reply With Quote
      #5    
    Old November 3rd, 2009, 11:06 AM
    VictorN's Avatar
    VictorN VictorN is offline
    Elite Member
    Power Poster
     
    Join Date: Jan 2003
    Location: Wallisellen (Zürich), Switzerland
    Posts: 10,221
    VictorN has a reputation beyond repute (3000+) VictorN has a reputation beyond repute (3000+) VictorN has a reputation beyond repute (3000+) VictorN has a reputation beyond repute (3000+) VictorN has a reputation beyond repute (3000+) VictorN has a reputation beyond repute (3000+) VictorN has a reputation beyond repute (3000+) VictorN has a reputation beyond repute (3000+) VictorN has a reputation beyond repute (3000+) VictorN has a reputation beyond repute (3000+) VictorN has a reputation beyond repute (3000+)
    Re: How can add path of all files to List Ctrl those are present in folder ?

    Quote:
    Originally Posted by vjshankwar View Post
    When browse for folder use, i want the ok button enable only when the folder haven't any other sub folder.
    Hmmm... And what does the "browse for folder" have to do with a "List Ctrl"?
    Quote:
    Originally Posted by vjshankwar View Post
    ... so please tell me How can add path of all files to List Ctrl those are present in folder ?
    Well, Arjay is right. You have to implement your own callback procedure for the "browse for folder" dialog and handle BFFM_SELCHANGED message there.
    __________________
    Victor Nijegorodov
    Reply With Quote
    Reply

    Bookmarks
    Go Back   CodeGuru Forums > Visual C++ & C++ Programming > Visual C++ Programming


    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 02:28 PM.



    Acceptable Use Policy


    The Network for Technology Professionals

    Search:

    About Internet.com

    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | E-mail Offers


    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.