Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

What is the resource type for .wav files?

Posted on 2002-07-19
5
Medium Priority
?
201 Views
Last Modified: 2013-11-20
I'm trying to load a resource handle so I can play a wave file using PlaySound(). I can't use AfxGetResourceHandle() because I have to walk a DLL chain in order to find my resource.

In this call:

AfxFindResourceHandle( MAKEINTRESOURCE( IDR_MY_WAVE),  RT_??? );

what is the resource type I need to find the wave file?

Thanks!
0
Comment
Question by:shadow66
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 8

Expert Comment

by:VinExpert
ID: 7165301
Hi,

Check the following sample

http://www.codeguru.com/multimedia/play_wav.shtml

and try passing the dll handle instead of app instance handle.

Hope this helps.
VinExpert
0
 

Author Comment

by:shadow66
ID: 7165645
Woah, VinExpert, that soln is way too complicated. I was looking for the resource type to enable use of AfxFindResourceHandle(). Found the answer in-house: the resource type is _T( "WAVE" ). So,

AfxFindResourceHandle( MAKEINTRESOURCE( IDR_MY_WAVE ), _T( "WAVE" );

is all I need to get the DLL handle needed by PlaySound().

Thanks anyway!
0
 
LVL 8

Accepted Solution

by:
VinExpert earned 600 total points
ID: 7166577
Hi,

If I have read it correctly, that link gives the solution that u have found out!!!. See the FindResource(...) function call there. It uses that one only.

VinExpert
0
 

Author Comment

by:shadow66
ID: 7166965
Okay, I see your point. But the answer was so buried in an overly complex solution that I didn't see it. What I really needed to know was that the string "WAVE" could be used in AfxFindResourceHandle as parm 2, and the solution your offered didn't use that fn at all. So I ended up digging deeper into AfxFindResourceHandle and discovered that parm 2 is in fact ultimately a string.

If I knew more about resources, I would have probably made the connection between your soln's use of FindResource() and my request for AfxFindResourceHandle(). Then again, if I knew more about resources, I wouldn't have been asking this question on EE.

Anyway, thanks for your help,
Jim
0
 
LVL 8

Expert Comment

by:VinExpert
ID: 7168893
Hi,

Anyway, self learning makes one very strong...

All the best.

Regards,
VinExpert
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question