Solved

What is the resource type for .wav files?

Posted on 2002-07-19
5
196 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 200 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows Drag & Drop Location 2 112
How to know only "File created" with EventLog 3 35
has22 challenge 11 107
matchUp  challenge 6 78
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.

697 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