Partager via


IDirectMusicGetLoader8::GetLoader

The GetLoader method retrieves a pointer to the loader object that created the stream.

Syntax

HRESULT GetLoader8(
  IDirectMusicLoader ** ppLoader
);

Parameters

ppLoader

Address of a variable that receives the IDirectMusicLoader interface pointer. Use QueryInterface to obtain IDirectMusicLoader8. The reference count of the interface is incremented.

Return Values

If the method succeeds, the return value is S_OK.

If it fails, the method can return E_NOINTERFACE.

Remarks

The following example function finds a reference to an object that needs to be accessed by the loader:

HRESULT GetReferencedObject(
  DMUS_OBJECTDESC *pDesc,          // Description of object.
  IStream *pIStream,               // Stream being parsed.
  IDirectMusicObject **ppIObject)  // Object to be accessed.
{
  IDirectMusicGetLoader *pIGetLoader;
  IDirectMusicLoader *pILoader;
  ppIObject = NULL;
  HRESULT hr = pIStream->QueryInterface(
     IID_IDirectMusicGetLoader,
     (void **) &pIGetLoader);
  if (SUCCEEDED(hr))
  {
    hr = pIGetLoader->GetLoader(&pILoader);
    if (SUCCEEDED(hr))
    {
    hr = pILoader->GetObject(pDesc, IID_IDirectMusicLoader,
      (void**) ppIObject);
    pILoader->Release();
    }
    pIGetLoader->Release();
  }
  return hr;
}

Requirements

**  Header:** Dmusici.h

See Also

© 2004 Microsoft Corporation. All rights reserved.