Click here to Skip to main content
15,913,941 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Templates... they are nasty!! Pin
Stuart Dootson3-Sep-09 21:44
professionalStuart Dootson3-Sep-09 21:44 
GeneralRe: Templates... they are nasty!! Pin
o.kauert3-Sep-09 23:27
o.kauert3-Sep-09 23:27 
GeneralRe: Templates... they are nasty!! Pin
Stuart Dootson3-Sep-09 23:37
professionalStuart Dootson3-Sep-09 23:37 
GeneralRe: Templates... they are nasty!! Pin
o.kauert4-Sep-09 0:54
o.kauert4-Sep-09 0:54 
GeneralRe: Templates... they are nasty!! Pin
Stuart Dootson4-Sep-09 1:00
professionalStuart Dootson4-Sep-09 1:00 
GeneralRe: Templates... they are nasty!! Pin
o.kauert4-Sep-09 1:40
o.kauert4-Sep-09 1:40 
GeneralRe: Templates... they are nasty!! Pin
Stuart Dootson4-Sep-09 1:52
professionalStuart Dootson4-Sep-09 1:52 
QuestionPlaySound(MAKEINTRESOURCE, IDR_WAVE_RANDOM... problem Pin
lctrncs3-Sep-09 7:08
lctrncs3-Sep-09 7:08 
The need to compile wav files into a Doc/View plus modeless dialog MFC program led to abandoning a functioning mechanism to play random wav files:

PlaySound("m_sStrConcatenatedStringWithPath",NULL,SND_FILENAME|SND_SYNC);

(where sStrConcatenatedStringWithPath = “/path/201.wav” etc.)

and adopting:

LPTSTR pRandomSound = m_sStrConcatenatedStringResource.GetBuffer(0);

PlaySound(MAKEINTRESOURCE, pRandomSound, GetModuleHandle(NULL), SND_SYNC|SND_RESOURCE);

m_sStrConcatenatedStringResource.ReleaseBuffer(0);

(where m_sStrConcatenatedStringResource = “IDR_WAVE_201” etc.).

...that fails to play the wav files even when...

PlaySound(MAKEINTRESOURCE, IDR_WAVE_201, GetModuleHandle(NULL), SND_SYNC|SND_RESOURCE);

will play the IDR_WAVE_201 resource.

Many attempts experimenting different ways to cast the CString to the LPTSTR and obtaining the handle to the executable led to the code above, which still will not play the random sound resource.

Suggestions?

"For a successful technology, reality must take precedence over public relations, for nature cannot be fooled." Richard Feynman, Minority Report to the Official Report on the Space Shuttle Challenger Crash

QuestionRe: PlaySound(MAKEINTRESOURCE, IDR_WAVE_RANDOM... problem Pin
David Crow3-Sep-09 7:18
David Crow3-Sep-09 7:18 
AnswerRe: PlaySound(MAKEINTRESOURCE, IDR_WAVE_RANDOM... problem Pin
lctrncs3-Sep-09 12:27
lctrncs3-Sep-09 12:27 
GeneralRe: PlaySound(MAKEINTRESOURCE, IDR_WAVE_RANDOM... problem Pin
David Crow3-Sep-09 18:15
David Crow3-Sep-09 18:15 
GeneralRe: PlaySound(MAKEINTRESOURCE, IDR_WAVE_RANDOM... problem Pin
lctrncs3-Sep-09 19:09
lctrncs3-Sep-09 19:09 
AnswerRe: PlaySound(MAKEINTRESOURCE, IDR_WAVE_RANDOM... problem Pin
iraclyKv3-Sep-09 22:58
iraclyKv3-Sep-09 22:58 
AnswerMore Detailed Information About the Problem Re: PlaySound(MAKEINTRESOURCE, IDR_WAVE_RANDOM... problem Pin
lctrncs4-Sep-09 9:06
lctrncs4-Sep-09 9:06 
QuestionHow to create detailed log.txt file in C programming. Pin
mohant$.net3-Sep-09 3:00
mohant$.net3-Sep-09 3:00 
AnswerRe: How to create detailed log.txt file in C programming. Pin
Hamid_RT3-Sep-09 3:28
Hamid_RT3-Sep-09 3:28 
AnswerRe: How to create detailed log.txt file in C programming. Pin
Maximilien3-Sep-09 3:44
Maximilien3-Sep-09 3:44 
QuestionRe: How to create detailed log.txt file in C programming. Pin
David Crow3-Sep-09 5:10
David Crow3-Sep-09 5:10 
AnswerRe: How to create detailed log.txt file in C programming. Pin
Chris Losinger3-Sep-09 11:31
professionalChris Losinger3-Sep-09 11:31 
QuestionCursor freeze in rich edit control Pin
theCPkid3-Sep-09 2:47
theCPkid3-Sep-09 2:47 
AnswerRe: Cursor freeze in rich edit control Pin
Code-o-mat3-Sep-09 4:20
Code-o-mat3-Sep-09 4:20 
GeneralRe: Cursor freeze in rich edit control Pin
theCPkid4-Sep-09 21:19
theCPkid4-Sep-09 21:19 
QuestionHow can i chk the file is readonly or not? Pin
Le@rner3-Sep-09 1:40
Le@rner3-Sep-09 1:40 
AnswerRe: How can i chk the file is readonly or not? Pin
Michael Schubert3-Sep-09 1:44
Michael Schubert3-Sep-09 1:44 
GeneralRe: How can i chk the file is readonly or not? Pin
Le@rner3-Sep-09 1:57
Le@rner3-Sep-09 1: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.