The IDirect3DMaterial2::GetHandle method obtains the material handle of the Direct3DMaterial object. This handle is used in all Direct3D methods in which 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.
HRESULT GetHandle(
LPDIRECT3DDEVICE2 lpDirect3DDevice2,
LPD3DMATERIALHANDLE lpHandle
);
If the method succeeds, the return value is D3D_OK.
If the method fails, the return value is DDERR_INVALIDOBJECT.
In the IDirect3DMaterial interface, this method uses a pointer to a Direct3DMaterial object instead of a Direct3DMaterial2 object.
Windows NT: Use version 5.0 or later.
Windows: Use Windows 95 or later. Available as a redistributable for Windows 95.
Windows CE: Unsupported.
Header: Declared in d3d.h.
Import Library: Use ddraw.lib.