Microsoft DirectX 9.0 SDK Update (October 2004) |
The GetObject method retrieves an object from a file or resource and returns the specified interface.
Syntax
HRESULT GetObject(
LPDMUS_OBJECTDESC pDesc,
REFIID riid,
LPVOID FAR * ppv
);
Parameters
pDesc
Address of a DMUS_OBJECTDESC structure describing the object.
riid
Unique identifier of the interface. See DirectMusic Interface GUIDs.
ppv
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.
DMUS_S_PARTIALLOAD is returned if any referenced object cannot be found, such as a
If it fails, the method can return one of the error values shown in the following table.
Return code |
DMUS_E_LOADER_FAILEDCREATE |
DMUS_E_LOADER_FAILEDOPEN |
DMUS_E_LOADER_FORMATNOTSUPPORTED |
DMUS_E_LOADER_NOCLASSID |
E_FAIL |
E_INVALIDARG |
E_OUTOFMEMORY |
E_POINTER |
REGDB_E_CLASSNOTREG |
Remarks
For file objects, it is simpler to use the IDirectMusicLoader8::LoadObjectFromFile method.
DirectMusic does not support loading from URLs. If the dwValidData member of the DMUS_OBJECTDESC structure contains DMUS_OBJ_URL, the method returns DMUS_E_LOADER_FORMATNOTSUPPORTED.
The method does not require that all valid members of the DMUS_OBJECTDESC structure match before retrieving an object. The dwValidData flags are evaluated in the following order:
In other words, the highest priority goes to a unique GUID, followed by a stream pointer, followed by a resource, followed by the full file path name, followed by an internal name plus category, followed by an internal name, followed by a local file name.
Do not load data from untrusted sources. Loading DirectMusic data files causes objects to be constructed, with the possibility that excessive demand on resources will lead to degradation of performance or system failure.
Requirements
Header: Dmusici.h
Library: Dmloader.dll, Dmloaded.dll
See Also