How create device without window?

When I set this parameter as null, is throwing exception "Error in the application". Why?

In MSDN -

renderWindowHandleSystem.IntPtr
Handle to a Form, Panel, or any other Control derived class. This parameter indicates the surface to bind to the device.

For full-screen mode, the window specified must be a top-level window.

For windowed mode, this parameter can be null. If null is specified, a non-null handle must be specified when calling Device.Present. This can be done either by setting the PresentParameters.DeviceWindow property, or by using the optional param_Control_overrideWindow parameter of the Device.Present method.

[1143 byte] By [Chort] at [2007-12-24]
# 1

The simple answer is that you cannot do this...

I once try to do that for a Filter that was suppose to run in a DLL

And basicly you will need a Handle to an existing window

You can create a very basic window that will open briefly

or hide a Edit on a form and use this hiden window to get a Handle

Etienne2005 at 2007-10-8 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: Graphics...
# 2
This might be a bug in the Managed DX layer... But you're gonna need a window handle sooner or later... Why not pass it sooner?
WessamBahnassi at 2007-10-8 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: Graphics...
# 3
I must create 3D image in the web server and pass it to client. I haven't window.
Chort at 2007-10-8 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: Graphics...
# 4
Create a small invisible window on the web server with your D3D service before it creates the D3D device...
WessamBahnassi at 2007-10-8 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: Graphics...