HRESULT GetHandle(LPDIRECT3DDEVICE lpDirect3DDevice,
LPD3DMATERIALHANDLE lpHandle);
Obtains the material handle for the Direct3DMaterial object. This handle is used in all Direct3D API calls where a material is to be referenced. A material can be used by only one device at a time.
If the device is destroyed, the material is disassociated from the device.
·Returns D3D_OK if successful, or DDERR_INVALIDOBJECT otherwise.
lpDirect3DDevice
Address of the Direct3DDevice object in which the material is being used.
lpHandle
Address of a variable that will be filled with the material handle corresponding to the Direct3DMaterial object.