Alex Mueller on Software and Technology 
Tuesday, February 15, 2005
The other day I was adding sound into my project for work. The ability to play sound in .NET is not native; there is not a sound namespace. In order to do this I had to use platform invocation services and unmanaged assemblies, specifically the winmm.dll. There are a number of tutorials on how to accomplish this so I will not provide mine here.

What I did find interesting is how does one determine the appropriate function signatures of the unmanaged assemblies? In my case I am told the signature to the PlaySound method of the winmm.dll is PlaySound(string Sound, IntPtr Mod, int SoundFlag) where I use an enum to represent SoundFlag. What I am trying to determine is how could I have discovered the signature of PlaySound if I had not been told in a tutorial? I know these signatures exist in some H file somewhere, but where?

I was introduced to DependencyWalker, a free utility that examines assemblies, executables, and more. I loaded up my winmm.dll, and I could now see all the functions available within this assembly, but I still cannot see what parameters those functions require. I then installed Asmex, a free .NET assembly utility. Again, while I can see my PlaySound function, I cannot tell what it takes.

If anyone knows of a solution to this problem, I would be grateful to hear it.
Tuesday, February 15, 2005 12:30:09 PM (Mountain Standard Time, UTC-07:00) | Comments [0] | #
Comments are closed.
MuellerDesigns.net
Search
On This Page
The Split Personality of the Tester/Developer
Cross Site Scripting (XSS)
Creating files with FSUTIL
PowerShell Management Library for Hyper-V
Installing Windows 7
Installing Linux in Hyper-V
Internet Explorer 8 Release Candidate 1
PowerShell Documentation
Automate Daily Tasks with PowerShell
SketchPath XPath Editor
Software Testing - Revisited
Architecting Buildings and Software
NBCOlympics.com with Silverlight
Marker Interfaces and C# Attributes
Most Popular
JavaScript ReplaceAll Functionality
What is polymorphism?
What is composition?
Sorting with IComparable and IComparer
Applying the Observer Pattern in ASP.NET
MVP in ASP.NET
What is abstraction?
What is encapsulation?
What is a class?
What is inheritance?
Authentication in ASP.NET
Calendar Controls
XPathNavigator.CheckValidity new for 2.0
SQL Server 2005 Connection Issues
Auto-attach to process '[####] aspnet_wp.exe' on m...
What is an object?
FreeTextBox
VMWare and VPC
An Example of Reflection using C#
Changing File Ownership In Vista and Longhorn
Archive
Links
Categories
My Local Blog Map
Blogroll
About
Powered by:

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2010
MuellerDesigns.net

Sign In

Help Those In Need
The Hunger Site
Ronald McDonald House Charities (RMHC) of Western Washington & Alaska