Solved

DirectSoundEnumerate

Posted on 1998-07-08
6
377 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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 

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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Suggested Solutions

zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

831 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