Solved

What is the resource type for .wav files?

Posted on 2002-07-19
5
193 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
  • 3
  • 2
5 Comments
 
LVL 8

Expert Comment

by:VinExpert
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Hi,

Anyway, self learning makes one very strong...

All the best.

Regards,
VinExpert
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now