The IDirect3DMaterial3::GetHandle method binds a material to a device, retrieving a handle that represents the association between the two. 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(
LPDIRECT3DDEVICE3 lpDirect3DDevice,
LPD3DMATERIALHANDLE lpHandle
);
If the method succeeds, the return value is D3D_OK.
If the method fails, the return value is DDERR_INVALIDOBJECT.
In the IDirect3DMaterial2 interface, this method accepts a pointer to an IDirect3DDevice2 interface instead of an IDirect3DDevice3 interface.
Windows NT/2000: Requires Windows 2000.
Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
Header: Declared in d3d.h.
Import Library: Use ddraw.lib.