zaryk
April 26th, 2008, 01:52 PM
I am using mcisendstring in my code, and was quite happy to find that it was easy to implement.
mciSendString("open myFile type mpegvideo alias myFile", NULL, 0, 0);
mciSendString("play myFile", NULL, 0, 0);
Is there a way to use a variable as myFile.
string myFile;
mciSendString("open " + myFile + " type mpegvideo alias myFile", NULL, 0, 0);
mciSendString("play myFile", NULL, 0, 0);
If i use a string it errors this:
49 C:\Documents and Settings\user\My Documents\SharpDevelop Projects\c++\winapi\main2.cpp cannot convert `std::basic_string<char, std::char_traits<char>, std::allocator<char> >' to `const CHAR*' for argument `1' to `MCIERROR mciSendStringA(const CHAR*, CHAR*, UINT, HWND__*)'
if i use char*:
49 C:\Documents and Settings\user\My Documents\SharpDevelop Projects\c++\winapi\main2.cpp invalid operands of types `char*' and `const char[100]' to binary `operator+'
mciSendString("open myFile type mpegvideo alias myFile", NULL, 0, 0);
mciSendString("play myFile", NULL, 0, 0);
Is there a way to use a variable as myFile.
string myFile;
mciSendString("open " + myFile + " type mpegvideo alias myFile", NULL, 0, 0);
mciSendString("play myFile", NULL, 0, 0);
If i use a string it errors this:
49 C:\Documents and Settings\user\My Documents\SharpDevelop Projects\c++\winapi\main2.cpp cannot convert `std::basic_string<char, std::char_traits<char>, std::allocator<char> >' to `const CHAR*' for argument `1' to `MCIERROR mciSendStringA(const CHAR*, CHAR*, UINT, HWND__*)'
if i use char*:
49 C:\Documents and Settings\user\My Documents\SharpDevelop Projects\c++\winapi\main2.cpp invalid operands of types `char*' and `const char[100]' to binary `operator+'