Microsoft DirectX 8.0 (C++) |
Searches a directory or disk for all files of a requested class type and file name extension. For each file found, it calls the IDirectMusicObject8::ParseDescriptor method to extract the GUID and name of the object. This information is stored in an internal database. After a directory has been scanned, all files of the requested type become available for enumeration through the IDirectMusicLoader8::EnumObject method; in addition, an object can be retrieved by using IDirectMusicLoader8::GetObject, even without a file name.
HRESULT ScanDirectory( REFGUID rguidClass, WCHAR* pwzFileExtension, WCHAR* pwzScanFileName );
If the method succeeds, the return value is S_OK, or S_FALSE if no files were found.
If it fails, the method can return one of the following error values:
DMUS_E_NOT_FOUND |
E_FAIL |
E_OUTOFMEMORY |
E_POINTER |
REGDB_E_CLASSNOTREG |
The IDirectMusicLoader8::SetSearchDirectory method must be called first to set the location to search.
The scanned information can be stored in a cache file defined by pwzScanFileName. After it has been so stored, subsequent calls to ScanDirectory are much quicker because only files that have changed are scanned (the cache file stores the file size and date for each object, so it can tell if a file has changed).
GUID_DirectMusicAllTypes is not a valid value for rguidClass.
If the file type has more than one possible extension, call ScanDirectory once for each file name extension.
Header: Declared in dmusici.h.