The IDirect3D interface is an interface to a DirectDraw object. To create an IDirect3D interface, you can call the IDirectDraw2::QueryInterface method, as follows:
lpDirectDraw->QueryInterface(
IID_IDirect3D, // IDirect3D interface ID
lpD3D); // Address of a Direct3D object
The object referred to by an IDirect3D interface contains a list of viewports, lights, materials, and devices. You can use the methods of the IDirect3D interface to create other objects or to find Direct3D devices.