![]() |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
This section gives a practical overview of how the various DirectSound interfaces are used in order to play and capture sound. The following topics are discussed:
Most of the examples of method calls throughout this section are given in the C language form, which accesses methods by means of a pointer to a table of pointers to functions, and requires a thispointer as the first parameter in any call. For example, a C call to the IDirectSound::GetCapsmethod takes this form:
lpDirectSound->lpVtbl->GetCaps(lpDirectSound, &dscaps);
The same method call in the C++ form, which treats COM interface methods just like class methods, looks like this:
lpDirectSound->GetCaps(&dscaps);
Dsound.h contains macros that expand to either the C or C++ form of the method call, depending on the environment. These macros simplify the C calls and also make it possible to develop routines that can be used in either language. For example:
IDirectSound_GetCaps(lpDirectSound, &dscaps);
Last updated on Tuesday, May 18, 2004
© 2004 Microsoft Corporation. All rights reserved.