Share via


IDirectMusicLoader::SetSearchDirectory

This 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

OS Versions: Windows CE .NET 4.0 and Windows CE .NET 4.1.
Header: Dmusici.h.
Link Library: Dmusic.lib.

See Also

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

 Last updated on Monday, April 12, 2004

© 1992-2002 Microsoft Corporation. All rights reserved.