Microsoft DirectX 8.0 (C++) |
This section contains references for DirectMusic COM interfaces.
Interfaces in the current version are either declared or defined with names ending in 8. To be sure of using the latest version of an interface, always include this suffix when declaring the pointer.
Note IKsControl and IReferenceClock are exceptions to this rule.
Interfaces retrieved by methods are always the base version. Where a newer version exists, you must call QueryInterface to obtain it, as in the following example, where lpdmBand is an IDirectMusicBand8 interface pointer.
IDirectMusicSegment * lpdmseg; IDirectMusicSegment8 * lpdmseg8; HRESULT hr = lpdmBand->CreateSegment(&lpdmseg); if (SUCCEEDED(hr)) { hr = lpdmseg->QueryInterface(IID_IDirectMusicSegment8, (LPVOID *)&lpdmseg8); }
Where there is no new version of an interface, the interface name with the suffix 8 is only a define. For example, IDirectMusicGraph8 is equivalent in all respects to IDirectMusicGraph. In such cases it is not necessary to query for a new interface, but doing so does no harm and can make your code easier to maintain for future versions of DirectX.
When a method takes an interface pointer as an IN parameter, you can pass in the newer version even where the method is declared as accepting the older version. For example, a pointer to either IDirectMusicSegment or IDirectMusicSegment8 can be passed to IDirectMusicPerformance8::PlaySegmentEx.
This documentation contains full reference topics only for the latest versions of interfaces. Where a define exists, such as IDirectMusicGraph8, the interface is documented under that name.