locked
Windows Form Application: Get files in folder. RRS feed

  • Question

  • I am trying to use Visual C++ Form Application and show a MessageBox telling the name of each file in the C:/OSX/ folder (on my computer).

    Ex:

    C:/OSX/run.exe

    A message box will pop up saying "run.exe"

    Thanks.


    Newbie at Visual C++ - Trying to accomplish a dream, but need a little help.
    Sunday, April 10, 2011 1:44 AM

Answers

All replies

  • >I am trying to use Visual C++ Form Application and show a
    >MessageBox telling the name of each file in the C:/OSX/
    >folder (on my computer).

    Wouldn't a ListBox be more appropriate if there are
    multiple files in the folder?

    You can use FindFirstFile/FindNextFile/FindClose
    to get the names of the files.

    Listing the Files in a Directory
    http://msdn.microsoft.com/en-us/library/aa365200(v=VS.85).aspx

    - Wayne
    • Marked as answer by Bailey McAfee Sunday, April 10, 2011 5:50 AM
    • Unmarked as answer by Bailey McAfee Sunday, April 10, 2011 3:43 PM
    • Marked as answer by Bailey McAfee Monday, April 18, 2011 3:41 AM
    Sunday, April 10, 2011 2:34 AM
  • Hi Wayne,

    Is it possible I could have an example of using that in a Form Project?

    I looked through the codes. Very confusing to translate.

    Thanks for your support,

    Bailey


    Newbie at Visual C++ - Trying to accomplish a dream, but need a little help.
    Sunday, April 10, 2011 3:47 PM
  • Use DirectoryInfo::GetFiles.
    Nikita Leontiev
    • Marked as answer by Bailey McAfee Monday, April 18, 2011 3:40 AM
    Sunday, April 10, 2011 4:11 PM