Allowing User To Select Directory..
In this function, I'm trying to allow the user to select which directory the mp3 playlist is saved to..
Code:
void savePlaylist()
{
string directoryToSaveTo;
cout << "What directory would you like to load a playlist from?" << endl
<< "The file must be a file named playlist.wpl" << endl
<< "Example: C:\\" << endl;
cin >> directoryToSaveTo;
cout << endl << endl;
directoryToSaveTo = directoryToSaveTo + "playlist.wpl";
ofstream playlist;
playlist.open(directoryToSaveTo); //compiler error here, the open function is
//supposed to be used like this:
//playlist.open("c:\playlist.wpl");
playlist << "<?wpl version=\"1.0\"?>" << endl
<< "<smil>" << endl
<< " <head>" << endl
<< " <meta name=\"Generator\" content=\"Microsoft Windows Media Player -- 10.0.0.4036\"/>" << endl
<< " <author/>" << endl
<< " <title>Playlist</title>" << endl
<< " </head>" << endl
<< " <body>" << endl
<< " <seq>" << endl;
for(int j = 1; fileAddresses[j] != ""; j++)
playlist << " <media src=\"" << fileAddresses[j] << "\"/>" << endl;
playlist << " </seq>" << endl
<< " </body>" << endl
<< "</smil>" << endl;
playlist.close();
cout << "\nPlaylist saved to c:\\playlist.wpl" << endl;
quitMessage();
}
I want to be able to have the user select where the playlist gets saved, but I get the compiler error:
Quote:
cannot convert parameter 1 from 'std::string' to 'const wchar_t *'
What can I do to get around this problem?