• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 203
  • Last Modified:

What is the resource type for .wav files?

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
shadow66
Asked:
shadow66
  • 3
  • 2
1 Solution
 
Vinayak KumbarSr Program ManagerCommented:
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
 
shadow66Author Commented:
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
 
Vinayak KumbarSr Program ManagerCommented:
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
 
shadow66Author Commented:
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
 
Vinayak KumbarSr Program ManagerCommented:
Hi,

Anyway, self learning makes one very strong...

All the best.

Regards,
VinExpert
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now