Jump to content

  • Log In with Google      Sign In   
  • Create Account

Directx fails to start in MSVC++ 2010


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 ILoveJesus   Members   -  Reputation: 166

Like
0Likes
Like

Posted 17 June 2013 - 05:11 PM

This is in Directx11 BTW. The code is fine. This code worked fine 5 months ago and I never touched it since. For some reason every project I try to debug fails because it cannot start Directx. Here is the code

for( driver = 0; driver < totalDriverTypes; ++driver )
    {
        result = D3D11CreateDeviceAndSwapChain( 0, driverTypes[driver], 0, creationFlags,
                                                featureLevels, totalFeatureLevels,
                                                D3D11_SDK_VERSION, &swapChainDesc, &swapChain_,
                                                &d3dDevice_, &featureLevel_, &d3dContext_ );

        if( SUCCEEDED( result ) )
        {
            driverType_ = driverTypes[driver];
            break;
        }
    }

    if( FAILED( result ) )
    {
        DXTRACE_MSG( "Failed to create the Direct3D device!" );
        return false;
    }

Basically the result fails every time when before this code worked perfectly fine. I already reinstalled the Directx SDK June 2010 and I reinstalled MSVS 2010. I went ahead and uninstalled recent MSVS redistributables that were installed since I last used MSVS. Didn't solve the problem. Oh and here is the error in the debugger...

 

c:\users\smoke\documents\visual studio 2010\projects\modnarengine\modnarengine\modnarenginebase.cpp(141): Failed to create the Direct3D device! hr=S_OK (0x00000000)

The program '[896] ModnarEngine.exe: Native' has exited with code -1 (0xffffffff).

 

Any help with what may be the problem is greatly appreciated. Help please.


Edited by ILoveJesus, 17 June 2013 - 05:16 PM.


Sponsor:

#2 phil_t   Crossbones+   -  Reputation: 4093

Like
0Likes
Like

Posted 17 June 2013 - 06:32 PM

What's the value of "result"? Clearly it's not S_OK, since then FAILED(result) would be false.



#3 ILoveJesus   Members   -  Reputation: 166

Like
0Likes
Like

Posted 17 June 2013 - 07:00 PM

What's the value of "result"? Clearly it's not S_OK, since then FAILED(result) would be false.

The value of result is E_FAIL through each iteration of the for loop and E_INVALIDARG at the end of the loop. It fails every time even though it shouldn't. I am trying to explain that the code is fine and that something else is the problem. I just don't know what that is. I tried uninstalling programs like AVG and anything else I installed since this code worked fine but to no avail. I have literally over 10 projects that worked fine months ago when I last debugged them with the same code. I come back months later to find that no of them run, they compile, they just don't run because the CreateDevice fails every time. The last resort is to wipe my hard drive and reinstall windows I am just hoping to avoid that.


Edited by ILoveJesus, 17 June 2013 - 07:12 PM.


#4 ATEFred   Members   -  Reputation: 1125

Like
0Likes
Like

Posted 18 June 2013 - 02:07 AM

If you are creating the device with the debug flag, you now need to have vs2012 or the free remote debugging vs2012 tools installed on your machine, after a windows update a few months ago. Maybe that is causing your issue? If device creation succeeds without the debug flag, this is the issue.



#5 ILoveJesus   Members   -  Reputation: 166

Like
0Likes
Like

Posted 18 June 2013 - 02:09 AM

If you are creating the device with the debug flag, you now need to have vs2012 or the free remote debugging vs2012 tools installed on your machine, after a windows update a few months ago. Maybe that is causing your issue? If device creation succeeds without the debug flag, this is the issue.

 

 Thank you so much. Problem solved. Why in the world do they make changes like that though?


Edited by ILoveJesus, 18 June 2013 - 02:13 AM.


#6 ATEFred   Members   -  Reputation: 1125

Like
1Likes
Like

Posted 18 June 2013 - 03:04 AM

 

If you are creating the device with the debug flag, you now need to have vs2012 or the free remote debugging vs2012 tools installed on your machine, after a windows update a few months ago. Maybe that is causing your issue? If device creation succeeds without the debug flag, this is the issue.

 

 Thank you so much. Problem solved. Why in the world do they make changes like that though?

 

I'm sure there are plenty of reasons for the change (I think linked with the advent of dx11.1 on win8), but yeah, the lack of forward warning on the issue is kind of lame. Glad it fixed your issue at least.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS