Advertisement

How to solve D3D11 CreateDevice failed? [Solved]

Started by October 31, 2017 08:15 PM
23 comments, last by pranciskus2 7 years, 3 months ago
2 hours ago, pranciskus2 said:

My code returns false here but I don't know what to do

You are not really failing at D3DApp::Init. Inside this method there is a call to InitDirect3D and inside of that method there is a call to D3D11CreateDevice which returns the error code you need. Place a break point at that line with the call to D3DApp::Init and step through the code. Eventually you'll get to the error code you need

46 minutes ago, noodleBowl said:

You are not really failing at D3DApp::Init. Inside this method there is a call to InitDirect3D and inside of that method there is a call to D3D11CreateDevice which returns the error code you need. Place a break point at that line with the call to D3DApp::Init and step through the code. Eventually you'll get to the error code you need

Look the problem is here. Second screenshot made after I closed the box: CreateDevice Failed.

Untitleds.png

Untitledss.png

I'm just curious in programming

Advertisement

noodleBowl is right, you're not debugging correctly, search this thread for 


HRESULT hr = D3D11CreateDevice(

that hresult will give you insight into whats going wrong.

-potential energy is easily made kinetic-

5 minutes ago, Infinisearch said:

noodleBowl is right, you're not debugging correctly, search this thread for 



HRESULT hr = D3D11CreateDevice(

this is probably the error but I don't understand it.

 

Untitleda.png

I'm just curious in programming

36 minutes ago, pranciskus2 said:


HRESULT hr = D3D11CreateDevice(

this is probably the error but I don't understand it.

This is definitely where the error is occurring

After the call to D3D11CreateDevice is complete that variable hr will have a value. This value is the error code you want. While debugging you can hover over it and Visual Studio will tell you the current assigned value. Then just check that value against the D3D docs to see why the device creation has failed


HRESULT hr = D3D11CreateDevice(/*passed in params*/);
//At this point (after the above call has completed) hr will have a value
//This value is the error code that you can cross check with the d3d docs to firgure out why device creation is failing
if(FAILED(hr))
{
  /*Show the window that says we failed to create the D3D Device*/ 
}
6 hours ago, noodleBowl said:

In the code you posted there is this call in the InitDirect3D method. This will attempt to create the D3Ddevice, the HRESULT returned will be S_OK for the device was successfully created, otherwise like in your case it will return a different value that goes along with an error code. You can the use that error code and the D3D docs to narrow down why the device was not created

 

34 minutes ago, pranciskus2 said:

this is probably the error but I don't understand it.

Read above quoted post.

-potential energy is easily made kinetic-

Advertisement
15 minutes ago, noodleBowl said:

This is definitely where the error is occurring

After the call to D3D11CreateDevice is complete that variable hr will have a value. This value is the error code you want. While debugging you can hover over it and Visual Studio will tell you the current assigned value. Then just check that value against the D3D docs to see why the device creation has failed



HRESULT hr = D3D11CreateDevice(/*passed in params*/);
//hr will now have a value
//This value is the error code that you can cross check with the d3d docs to firgure out why device creation is failing
if(FAILED(hr))
{
  /*Show the window that says we failed to create the D3D Device*/ 
}

I very happy you trying to help me but where the error code should pop-up? is this the error code?sssss.thumb.png.56e6f7ed38720675086607a19a73ca7a.png

I'm just curious in programming

31 minutes ago, noodleBowl said:

This is definitely where the error is occurring

After the call to D3D11CreateDevice is complete that variable hr will have a value. This value is the error code you want. While debugging you can hover over it and Visual Studio will tell you the current assigned value. Then just check that value against the D3D docs to see why the device creation has failed



HRESULT hr = D3D11CreateDevice(/*passed in params*/);
//At this point (after the above call has completed) hr will have a value
//This value is the error code that you can cross check with the d3d docs to firgure out why device creation is failing
if(FAILED(hr))
{
  /*Show the window that says we failed to create the D3D Device*/ 
}

I pressed F10 and hr value is E_FAIL ( Attempted to create a device with the debug layer enabled and the layer is not installed) maybe I will find a solution easier now, but if u now the how to solve the problem, you could share, I would save some time :) Thanx for help

I'm just curious in programming

BTW have you read this:

http://www.d3dcoder.net/Data/Book4/d3d11Win10.htm

http://www.d3dcoder.net/Data/Book4/BlendDemo_win10_vs15.zip

or tried

https://www.microsoft.com/en-us/download/details.aspx?id=6812

 

 

-potential energy is easily made kinetic-

4 hours ago, Infinisearch said:

Yes, I heard about these problems but I can successfully compile BoxDemo because I use VS2010 and w7 as in the book. I think it's a problem with my gpu or gpu drivers I think I going to read directx 9.0 now because I don't want to waste my time being in frustration.

I'm just curious in programming

This topic is closed to new replies.

Advertisement