# Qt Application - CreateDevice just returns D3DERR_INVALIDCALL

This topic is 3925 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi. Im going nuts! I can do what I want, I just get an D3DERR_INVALIDCALL from CreateDevice. First of all, I created a dialog with qt where I can choose d3d stuff, like resolution, refresh rate, back fmt, depth/stencil fmt and so on... Everything works just fine. I get a Direct3d Object and I can do the whole enum stuff. But when I want to use the choosen values from the dialog, the device creation function just rejects my requests. Here is the dialog: and here is the present parameters struct, filled. I also tryed all vertex processing flags. In qt I get the hwnd id via winId() from the central widget of my main window. Thanks Alex

##### Share on other sites
Ok, I found it!

Man!

The refresh rate must be zero, if the present parameter flag "windowed" is true!

I found out how to enable the debug library!
I searched ages for this information, and finaly found it in the docs.

Thanks anyway
Alex

##### Share on other sites
But I still have a question.

How can I read this kind of information procedurally and write it into a file?

Thanks
Alex

##### Share on other sites
If you're familiar with the enum routines, fill the present parameters with the desired values and write the present parameters structure to a file.

fwrite(&mpp,sizeof(mpp),1,filePtr);

##### Share on other sites
Hi, thanks.

Actually, I think I know how to write this into a file.
I mean the dx debug info, for example.
Or is this done automatically by dx?

Thanks
Alex

##### Share on other sites
Quote:
 Original post by directNoobHi, thanks.Actually, I think I know how to write this into a file.I mean the dx debug info, for example. Or is this done automatically by dx?ThanksAlex
DirectX won't write anything to a file for you, no. Also, This is extremely relevant to your interests. Particularly since the example I give will be almost exactly the same problem you had in this case [smile]

##### Share on other sites
Hi Evil Steve.

This nice piece of information comes a bit to late!
I found the entry in the dx docs, where it is described how to enable the debug information.

I think I did well in enumerating my device with my dialog. It works just perfectly.

But, my concern now is, how can I get the debug information from dx?! - in order to write it into a file.

For example.
In OGL I can call a gl function ( glGetError or how it is called) after another gl function to retrieve debug/error information.

Is there any similar facility other than SUCCEEDED/FAILED to evaluate the success of dx functions, i.e getting the debug information?

Thanks
Alex

##### Share on other sites
Quote:
 Original post by directNoobFor example.In OGL I can call a gl function ( glGetError or how it is called) after another gl function to retrieve debug/error information.Is there any similar facility other than SUCCEEDED/FAILED to evaluate the success of dx functions, i.e getting the debug information?
You'd have to do that yourself, via something like:
g_lastError = pDevice->SomeFunc();if(FAILED(g_lastError)){   //...}

There's DXGetErrorString and DXGetErrorDescription, which will give you a string error from a HRESULT code, but you need to have the result to pass to the function, there's no "last error" functionality like in OpenGL, or Win32's GetLastError().

1. 1
Rutin
42
2. 2
3. 3
4. 4
5. 5

• 18
• 20
• 14
• 14
• 9
• ### Forum Statistics

• Total Topics
633370
• Total Posts
3011544
• ### Who's Online (See full list)

There are no registered users currently online

×