Solved

DirectSoundEnumerate

Posted on 1998-07-08
6
390 Views
Last Modified: 2013-12-03
My app uses waveout and if available directsound. If I link to dsound.lib and my app is run on a machine that does not have directx installed, user will receive 'dsound.dll not found message'. Therefore I would like to use COM interface so that I don't have to link to dsound.lib.

I only use two dsound.lib functions: DirectSoundCreate and DirectSoundEnumerate. I can use COM interface to do DirectSoundCreate but I don't know how to do DirectSoundEnumerate. Thanks for your help!
0
Comment
Question by:overworked
[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
  • 4
  • 2
6 Comments
 
LVL 23

Expert Comment

by:chensu
ID: 1409670
What do you mean? DirectSoundCreate and DirectSoundEnumerate are just normal functions, not COM interfaces. Why can't you do DirectSoundEnumerate while you can do DirectSoundCreate?
0
 

Author Comment

by:overworked
ID: 1409671
I can accomplish a DirectSoundCreate by doing a CoCreateInstance on the CLSID_DirectSound / IID_IDirectSound but there's no COM interface or method to accomplish a DirectSoundCreate. Therefore I need to extern it and link to dsound.lib which causes 'dsound.dll not found' message to appear when user does not have DX installed. However, I think I'll just dynamically link.
0
 

Author Comment

by:overworked
ID: 1409672
Oops, in previous text substitute 'method to accomplish a DirectSoundEnumerate' with text 'method to accomplish a DirectSoundCreate'.
0
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 

Author Comment

by:overworked
ID: 1409673
Ignore, here's comment with out my error:

I can accomplish a DirectSoundCreate by doing a CoCreateInstance on the CLSID_DirectSound / IID_IDirectSound but there's no COM interface or method to accomplish a DirectSoundEnumerate. Therefore I need to extern it and link to dsound.lib which causes 'dsound.dll not found' message to appear when user does not have DX installed. However, I think I'll just dynamically link.

0
 
LVL 23

Accepted Solution

by:
chensu earned 100 total points
ID: 1409674
That's easy to accomplish. Use LoadLibrary to load the dsound.dll. If sucessful, use GetProcAddress to get the function pointer. Note the actual function names are DirectSoundEnumerateA (ANSI version) and DirectSoundEnumerateW (Unicode version).
0
 

Author Comment

by:overworked
ID: 1409675
I know, I know :)

0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

717 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