Why does CreateDevice() fail?

Started by
20 comments, last by Ice-T 20 years, 8 months ago
Actually it works like this:

If you don't specify a focus window (the argument to CreateDevice), you won't be able to go full-screen. Otherwise not a problem.

If you don't specify a device window (in D3DPRESENT_PARAMETERS), the focus window will be used for the device window.

If you don't specify either, device creation will fail. In other words, the device window is required. If you don't specify it explicitly, you must provide a focus window which will be used implicitly. One way or another the runtime requires a window in this role.

I would advise against using the desktop window in either role, especially as the focus window.

EDIT: To clarify, this is a bad idea because the focus window is subclassed when you go full-screen. You don't want to be doing this to the desktop window.

[edited by - Donavon Keithley on August 15, 2003 10:54:04 PM]

[edited by - Donavon Keithley on August 15, 2003 10:57:35 PM]
Donavon KeithleyNo, Inky Death Vole!
Advertisement
quote:Original post by Ice-T
I tried all the suggestions like creating and registering before creating the deviece and I keep getting the same error. When I ran D3DSpy, I got the same message, that CreateDevice returned "Invalid Call". That is the Debug Output part right?


No. If you use VisualC++ when you run the programmer in the debugger there is a debug window that receives input. Lots of helpful error and warning messages are written there.

For example, I set my video mode to 24-bit and then ran a windowed mode sample. It gave this error:
Direct3D9: (ERROR) :Invalid value for BackBufferFormat. ValidatePresentParameters fails.

If you don''t use VC++ (or want to run without having the IDE loaded) you can download DebugView from www.sysinternals.com

Stay Casual,

Ken
Drunken Hyena
Stay Casual,KenDrunken Hyena

This topic is closed to new replies.

Advertisement