Microsoft DirectX 8.0 (C++)

IDirectMusicLoader8::LoadObjectFromFile

Retrieves the specified object from a file and returns the desired interface. This method can be used instead of IDirectMusicLoader8::GetObject when the object is in a file.

HRESULT LoadObjectFromFile(
  REFGUID rguidClassID, 
  REFIID iidInterfaceID, 
  WCHAR *pwzFilePath, 
  void ** ppObject
);

Parameters

rguidClassID
Unique identifier for the class of object. For a list of standard loadable classes, see IDirectMusicLoader8.
iidInterfaceID
Unique identifier of the interface. See the IID defines in Dmusici.h. All the standard interfaces have a defined identifier consisting of "IID_" plus the name of the interface. For example, the identifier of IDirectMusicTrack8 is IID_IDirectMusicTrack8.
pwzFilePath
Name of the file that contains the object. The path can be fully qualified or relative to the search directory.
ppObject
Address of a variable that receives a pointer to the desired interface of the object.

Return Values

If the method succeeds, the return value is S_OK or DMUS_S_PARTIALLOAD.

If it fails, the method can return one of the following error values.

E_FAIL
E_INVALIDARG
E_OUTOFMEMORY
E_POINTER
DMUS_E_LOADER_NOCLASSID
DMUS_E_LOADER_FAILEDOPEN
DMUS_E_LOADER_FAILEDCREATE
DMUS_E_LOADER_FORMATNOTSUPPORTED
REGDB_E_CLASSNOTREG

Remarks

DMUS_S_PARTIALLOAD is returned if any referenced object cannot be found, such as a style referenced in a segment. The loader might fail to find the style if it is referenced by name but IDirectMusicLoader8::ScanDirectory has not been called for styles. DMUS_S_PARTIALLOAD might also mean that the default instrument collection file, Gm.dls, is not available.

Requirements

  Header: Declared in dmusici.h.

See Also

IDirectMusicLoader8::GetObject, IDirectMusicLoader8::SetSearchDirectory