Solved

DirectSoundEnumerate

Posted on 1998-07-08
6
357 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
  • 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
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.

 

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
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…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

760 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

20 Experts available now in Live!

Get 1:1 Help Now