Platform SDK: DirectX

IDirectMusicLoader::SetSearchDirectory

The IDirectMusicLoader::SetSearchDirectory method sets a search path for finding object files. The search path can be set for one object file type or for all files.

HRESULT SetSearchDirectory(
  REFGUID rguidClass,
  WCHAR* pwszPath,
  BOOL fClear
);

Parameters

rguidClass
Reference to (C++) or address of (C) the identifier of the class of objects that the call pertains to. GUID_DirectMusicAllTypes specifies all objects.
pwszPath
File path for directory. Must be a valid directory and must be less than MAX_PATH in length.
fClear
If TRUE, clears all information about objects before setting the directory. This avoids accessing objects from the previous directory that might have the same name. However, objects are not removed from the cache.

Return Values

If the method succeeds, the return value is S_OK, or S_FALSE if the search directory is already set to pwszPath.

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

E_OUTOFMEMORY
E_POINTER
DMUS_E_LOADER_BADPATH

Remarks

Once a search path is set, the loader does not need a full path every time it is given an object to load by file name. This enables objects that refer to other objects to find them by file name without knowing the full path.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Header: Declared in dmusici.h.

See Also

IDirectMusicLoader::ScanDirectory, Setting the Loader's Search Directory