For the purpose of creating a very simple mp3 player i would like to have a listview that allows a user to click on a listed file and play an audio file.
I figure that to solve this the program should display the contents of a directory containing the music files in listview.

Please could somebody explain very simply how to populate listview with the contents of a directory? I also realise that maybe listview may not be appropriate for this, if so what should i use.

p.s Im working with XP and visual studio 2005.

7 Years
Discussion Span
Last Post by Stefano Mtangoo

I have done something similar to this in c#, but have never translated to c++ although the process should be similar. Depending on what API you are using, you want to look wherever your music is, and loop through all the files in the directory, adding a string containing your files path to your list view as you go. Then using some audio playback functionality included with your API, grab the string of the file location from your listview depending on where you click and tell your program to open the audio file.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.