Click here to Skip to main content
15,921,467 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Return code to operating system Pin
David Crow3-Oct-06 5:09
David Crow3-Oct-06 5:09 
GeneralRe: Return code to operating system Pin
jsumm3-Oct-06 5:36
jsumm3-Oct-06 5:36 
Questionhow to get the ToS to set the QoS? Pin
Fred D.3-Oct-06 1:52
Fred D.3-Oct-06 1:52 
QuestionProblem with "PlaySound()" Function???? Pin
singersinger3-Oct-06 1:33
singersinger3-Oct-06 1:33 
AnswerRe: Problem with "PlaySound()" Function???? Pin
Steve S3-Oct-06 2:31
Steve S3-Oct-06 2:31 
GeneralRe: Problem with "PlaySound()" Function???? Pin
singersinger3-Oct-06 3:02
singersinger3-Oct-06 3:02 
GeneralRe: Problem with "PlaySound()" Function???? Pin
Demian Panello3-Oct-06 3:12
Demian Panello3-Oct-06 3:12 
GeneralRe: Problem with "PlaySound()" Function???? Pin
Steve S3-Oct-06 6:19
Steve S3-Oct-06 6:19 
You want to be able to play it synchronously, yet be able to stop it playing.
Can't do that, because PlaySound won't return until it's already finished.

You want to play it asynchronously, and get notified when it's stopped playing.
Can't do that, because PlaySound provides no notifications.

However, if you read what I wrote, you can get the behaviours that you want.

Spin another thread to call PlaySound synchronously. That thread can tell you when it's finished, and the effect on the other thread is that of playing it asynchronously.

If you want to stop it playing, you can call playsound with a purge option (as someone else has suggested) from the original thread, which will give you what you want.

Alternatively, you can try the MCI interface, or look at the waveOut* functions. However, using waveOut is a lot more complicated than using PlaySound with a second thread

There's a phrase which comes to mind: If you won't like the answer, don't ask the question...

Steve S
Developer for hire

AnswerRe: Problem with "PlaySound()" Function???? Pin
KaЯl3-Oct-06 4:10
KaЯl3-Oct-06 4:10 
QuestionCan u plz help... Pin
vc++_fragrance3-Oct-06 1:13
vc++_fragrance3-Oct-06 1:13 
AnswerRe: Can u plz help... Pin
Hamid_RT3-Oct-06 1:18
Hamid_RT3-Oct-06 1:18 
GeneralRe: Can u plz help... Pin
vc++_fragrance3-Oct-06 1:31
vc++_fragrance3-Oct-06 1:31 
GeneralRe: Can u plz help... Pin
Hamid_RT3-Oct-06 1:36
Hamid_RT3-Oct-06 1:36 
GeneralRe: Can u plz help... Pin
vc++_fragrance3-Oct-06 1:40
vc++_fragrance3-Oct-06 1:40 
GeneralRe: Can u plz help... Pin
Hamid_RT3-Oct-06 2:41
Hamid_RT3-Oct-06 2:41 
GeneralRe: Can u plz help... Pin
vc++_fragrance3-Oct-06 1:55
vc++_fragrance3-Oct-06 1:55 
GeneralRe: Can u plz help... Pin
Rajesh R Subramanian3-Oct-06 2:15
professionalRajesh R Subramanian3-Oct-06 2:15 
GeneralRe: Can u plz help... Pin
vc++_fragrance3-Oct-06 2:19
vc++_fragrance3-Oct-06 2:19 
JokeRe: Can u plz help... Pin
Hamid_RT3-Oct-06 2:43
Hamid_RT3-Oct-06 2:43 
GeneralRe: Can u plz help... Pin
benjymous3-Oct-06 2:52
benjymous3-Oct-06 2:52 
GeneralRe: Can u plz help... Pin
David Crow3-Oct-06 5:14
David Crow3-Oct-06 5:14 
GeneralRe: Can u plz help... Pin
vc++_fragrance4-Oct-06 0:43
vc++_fragrance4-Oct-06 0:43 
GeneralRe: Can u plz help... Pin
David Crow4-Oct-06 2:33
David Crow4-Oct-06 2:33 
GeneralRe: Can u plz help... Pin
vc++_fragrance4-Oct-06 4:18
vc++_fragrance4-Oct-06 4:18 
GeneralRe: Can u plz help... Pin
Hamid_RT4-Oct-06 6:57
Hamid_RT4-Oct-06 6:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.