The IDirectMusicLoader::CacheObject method tells the loader to keep a reference to the object. This guarantees that the object will not be loaded twice.
HRESULT CacheObject(
IDirectMusicObject * pObject
);
If the method succeeds, the return value is S_OK, or S_FALSE if the object is already cached.
If it fails, the method may return one of the following error values:
E_POINTER |
DMUS_E_LOADER_OBJECTNOTFOUND |
If you have an object that will be accessed in multiple places throughout the life of your program, letting the loader cache the object can significantly speed up performance. For an overview, see Caching Objects.
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.
IDirectMusicLoader::EnableCache, IDirectMusicLoader::ClearCache, IDirectMusicLoader::ReleaseObject