Im running a few tests for creating an MP3 player (very basic) and i'm having a few issues that I'm hoping somebody can help with.
Right.....
Im using mci for playback but what i need is the file path to be input by the user via a textbox. Ive created 3 strings that are eventually joined to create the full command and filename i.e L"play bad.mp3".
It is hoped that the textbox input will supply Sting^ spcom2 variable, but for testing purposes i've currently predefined String^ spcom2.
String^ spcom1 = "L\" play ";
String^ spcom2 = "bad.mp3";
String^ spcom3 = " \" ";
String^ spcomfull = spcom1+spcom2+spcom3;
My Version of MCI with string input (doesn't work)
mciSendString(spcomfull, NULL, 0, 0);
The problem is that mciSendString wont accept the string input, I know that it'll accept TCHAR
i.e TCHAR cpcomfull[MAX_PATH] = L"play bad.mp3"; The problem I have with this method is converting String^ to TCHAR.
So my questions are:
a) If it is possible to, what is the simplest method of converting a String^ into TCHAR (in its simplest form).
b) As i eventually want to implement a listbox/listview for the user to select and play audio tracks from (like itunes style), should I use a different method to pass filenames/paths to mciSendString?
Also, Im using Windows XP and Microsoft Visual Studio C++ 2010