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

C / C++ / MFC

 
AnswerRe: prblm regrading include files Pin
Michael Dunn14-Jun-06 21:32
sitebuilderMichael Dunn14-Jun-06 21:32 
AnswerRe: prblm regrading include files Pin
Tnarol14-Jun-06 22:05
Tnarol14-Jun-06 22:05 
AnswerRe: prblm regrading include files Pin
John R. Shaw15-Jun-06 1:19
John R. Shaw15-Jun-06 1:19 
QuestionHow to use Resources? Pin
_kal_14-Jun-06 20:58
_kal_14-Jun-06 20:58 
AnswerRe: How to use Resources? Pin
NiceNaidu14-Jun-06 21:11
NiceNaidu14-Jun-06 21:11 
AnswerRe: How to use Resources? Pin
Laxman Auti14-Jun-06 21:58
Laxman Auti14-Jun-06 21:58 
GeneralRe: How to use Resources? Pin
_kal_14-Jun-06 22:24
_kal_14-Jun-06 22:24 
AnswerRe: How to use Resources? Pin
Laxman Auti14-Jun-06 23:45
Laxman Auti14-Jun-06 23:45 
The following steps can be used with Resource Workshop:

1) Resource->New->NewType
2) Type in "ID_SOUND" or "ID_WAVE".
3) If you type yes for creating a resource id make
sure you have access to that symbol. For now
press No.
4) Resource->New and choose "SOUND" resource type.
This will bring up a text editor. Edit the text to
look similar to the syntax mentioned in the
section above.

NOTE: Wave files usually takes a lot of memory which means you might have very large resource files.
Now, let us examine how to access the wave file and play it
from the application. The following code can be used to load
and play the resource.
LPCSTR sound;   // A pointer to the binary wave file.
hResource = LoadResource( hInst,FindResource( hInst,MAKEINTRESOURCE(ID_SOUND),"SOUND" ) );
sound = ( LPCSTR )LockResource( hResource );
sndPlaySound( sound, SND_MEMORY );
UnlockResource( hResource );
FreeResource( hResource );
In the code above our resource type is "SOUND" and the resource
identifier ID_SOUND. We first use FindResource API function to
find the resource. This function returns a handle to the
resource. This handle is passed to the LoadResource which
returns a handle to a copy of the resource in memory. The
LockResource is next used to get a pointer to the resource. Once
a pointer is available, the latter can be used in a call to the
sndPlaySound() function. The second parameter, SND_MEMORY, is
used to denote that the first parameter is a pointer an in memory
copy of the wave file.

You have to include mmsystem.h header and link to winmm.lib library

wrote:

Knock out 't' from can't,
You can if you think you can
Cool | :cool:
Question,printing in tabular format [modified] Pin
GANsJob14-Jun-06 20:49
GANsJob14-Jun-06 20:49 
AnswerRe: ,printing in tabular format Pin
Cedric Moonen14-Jun-06 20:58
Cedric Moonen14-Jun-06 20:58 
AnswerRe: ,printing in tabular format Pin
NiceNaidu14-Jun-06 21:00
NiceNaidu14-Jun-06 21:00 
AnswerRe: ,printing in tabular format Pin
kakan14-Jun-06 22:05
professionalkakan14-Jun-06 22:05 
GeneralRe: ,printing in tabular format Pin
David Crow15-Jun-06 3:17
David Crow15-Jun-06 3:17 
GeneralRe: ,printing in tabular format Pin
kakan15-Jun-06 19:33
professionalkakan15-Jun-06 19:33 
AnswerRe: ,printing in tabular format Pin
Laxman Auti14-Jun-06 22:12
Laxman Auti14-Jun-06 22:12 
Questionsocket array Pin
shuchigo_jane14-Jun-06 20:34
shuchigo_jane14-Jun-06 20:34 
GeneralRe: socket array Pin
Laxman Auti14-Jun-06 20:39
Laxman Auti14-Jun-06 20:39 
QuestionHow to disable list view items? Pin
Roozbeh6914-Jun-06 20:24
professionalRoozbeh6914-Jun-06 20:24 
AnswerRe: How to disable list view items? Pin
Michael Dunn14-Jun-06 21:34
sitebuilderMichael Dunn14-Jun-06 21:34 
GeneralRe: How to disable list view items? Pin
Roozbeh6914-Jun-06 22:45
professionalRoozbeh6914-Jun-06 22:45 
QuestionRe: How to disable list view items? Pin
David Crow15-Jun-06 3:07
David Crow15-Jun-06 3:07 
QuestionVc++ hardware control classes? Pin
medvin14-Jun-06 20:23
medvin14-Jun-06 20:23 
AnswerRe: Vc++ hardware control classes? Pin
NiceNaidu14-Jun-06 20:37
NiceNaidu14-Jun-06 20:37 
GeneralRe: Vc++ hardware control classes? Pin
Hamid_RT14-Jun-06 20:41
Hamid_RT14-Jun-06 20:41 
AnswerRe: Vc++ hardware control classes? Pin
Hamid_RT14-Jun-06 20:43
Hamid_RT14-Jun-06 20:43 

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.