HI all,
Im trying to create a simple MP3 player. I hope that by amalgamating a series of strings, example 1, that they can collectively contain the full play and filename/path instruction instead of the self-contained method in example 2.
When I try to compile the solution in example 1 i get this error:-
error C2664: 'mciSendStringW' : cannot convert parameter 1 from 'System::String ^' to 'LPCWSTR'
parameter 1 being the 'spcomfull' part of this command 'mciSendString(spcomfull, NULL, 0, 0);'
The problem is, mciSendString wont allow a String^ to be used, it will allow
TCHAR spcomfull[PATH_MAX] = L"play bad.mp3"; but Im finding it a nightmare to convert String^ into TCHAR.
I really need the file to be stored as a string because i plan for the filename/path to be input by a user via a TextBox.
What I have noticed is that in Example 3 a media file can be opened and played via two commands and the filename/path is stored as myFile. Does anybody know the format in which the filename/path is taken from open to play commands, im guessing TCHAR??? Can I somehow manipulate alias myFile to take a String^ input???
Im beginning to think Im approaching the idea from the wrong angle? Any help would be really useful.
Cheers, Ian :)
Example 1
String^ spcom1 = "L\" play ";
String^ spcom2 = "bad.mp3";
String^ spcom3 = " \" ";
String^ spcomfull = spcom1+spcom2+spcom3;
mciSendString(spcomfull, NULL, 0, 0);
Example 2
mciSendString(L"play bad.mp3", NULL, 0, 0);
Example 3
mciSendString("open bad.mp3 type mpegvideo alias myFile", NULL, 0, 0);
mciSendString("play myFile", NULL, 0, 0);