I don't understand...

I don't understand why this program is not working. It was working on this pc before and now it isn't plz help.
Code:
1
2
3
4
5
6
7
8
9
10
11
#include <iostream>
#include <windows.h>
using namespace std;
int main(){
string file = "C:\\Documents and Settings\\Jason\\My Documents\\Jason\\My Music\\",filename;
cout<<"Enter the sound file's Name\nEX: Music.m4a\n>";
cin>>filename;
file=file+=filename;
if ((int)ShellExecuteA( NULL, "open", file.c_str(), NULL, NULL, SW_SHOWNORMAL ) <= 32)
cout<<"Playing!";
}
Last edited on
Could you tell us what error(s) you get?
here are no errors it outputs "Playing!" and nothing happens.
if ((int)ShellExecuteA( NULL, "open", file.c_str(), NULL, NULL, SW_SHOWNORMAL ) <= 32)
cout<<"Playing!";
}
I test find:
< 32 means error.
> 32 it's success.
okay so? I am not the person who wrote this program, I had a friend help me with a project and he really didn't explain anything to me.
Topic archived. No new replies allowed.