|
-
April 26th, 2008, 01:52 PM
#1
mcisendstring
I am using mcisendstring in my code, and was quite happy to find that it was easy to implement.
Code:
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.
Code:
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:
Code:
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*:
Code:
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+'
-
April 26th, 2008, 02:26 PM
#2
Re: mcisendstring
Thats a problem with strings. Nothing to do with mciSendString. You should write yourself a small test program to solidify your understanding of std::string, string literals, char*, etc, etc. For instance, before trying to create that string & use it as an argument to mciSendString, I'd write a small program to create that string & print it out with std::cout.
Here's a tutorial on strings:
http://www.cprogramming.com/tutorial/string.html
-
April 26th, 2008, 02:57 PM
#3
Re: mcisendstring
I figured it out without your insulting link of printing out strings, especially since i have a c++ class, making an "A", and the teacher tells me to help the other students. I was thinking c# thats what was wrong. But then again I probably deserved that insult as to thinking that people had higher intelligences, especially when I dont post all the code, cuz im thinking people are smarter than that.
Last edited by zaryk; April 26th, 2008 at 03:05 PM.
-
April 26th, 2008, 05:11 PM
#4
Re: mcisendstring
 Originally Posted by zaryk
I figured it out without your insulting link of printing out strings, especially since i have a c++ class, making an "A", and the teacher tells me to help the other students.
Congratulations, you're awesome.
At least have the decency to thank Martin for replying to your post, instead of calling his link "insulting"...
-
April 27th, 2008, 12:52 PM
#5
Re: mcisendstring
well, at least have the decency to post something useful.
-
April 27th, 2008, 01:08 PM
#6
Re: mcisendstring
Teaching you some manners is useful, indeed.
-
April 27th, 2008, 01:17 PM
#7
Re: mcisendstring
this has nothing to do with me not knowing manners, but that I choose not to use them, so your post was useless. Plus, my mother always told me to tell the truth, and I was telling the truth when I said that his link was insulting.
Last edited by zaryk; April 27th, 2008 at 01:21 PM.
-
April 27th, 2008, 01:19 PM
#8
Re: mcisendstring
 Originally Posted by zaryk
this has nothing to do with me not knowing manners, but that I choose not to use them, so your post was useless.
Get over yourself.
How can you expect to receive help if you're going to act like a little kid?
-
April 27th, 2008, 01:31 PM
#9
Re: mcisendstring
You better be glad that Jim fell asleep before he saw that, he would have taken that as an insult too, especially since he is 7. This is James, Im the main person in this head of mine or maybe that was Bob but anyway, Im 19. I have multiple-personality disorder. I am one out of 15, that I have counted so far. Sorry for his behavior.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|