The pPlaneEquation parameter of IDirect3DDevice7::SetClipPlane is not const IDirect3DDevice2::NextViewport takes an IDirect3DDevice2 interface, not an IDirect3DDevice3, the same for IDirect3DDevice::NextViewport.