Error creating a device with Microsoft.DirectX.Direct3D.Device (D3DERR_INVALIDCALL)

0

I am doing a desktop project on Winforms under the C # language together with Microsoft.DirectX.Direct3d, specifically Microsoft.Samples.DirectX.UtilityToolkit.Framework , to create a Device class that connects to my video output, for this I have a Nvidia GForce GT 520 card with output to two monitors, this running under a Windows XP 2002 Sp3 environment.

UtilityToolkit.Framework provides me with all the classes and methods I need to identify the two monitors (adapters) and the parameters I need to create the Device.

But at the moment I'm calling the constructor of the Device class I get the following error:

  

Error in the application.   -2005530516 (D3DERR_INVALIDCALL) at Microsoft.DirectX.Direct3D.Device..ctor (Int32 adapter, DeviceType   deviceType, IntPtr renderWindowHandle, CreateFlags behaviorFlags,   PresentParameters [] presentationParameters) at   Microsoft.Samples.DirectX.UtilityToolkit.Framework.ChangeDevice (DeviceSettings   newDeviceSettings, Device deviceFromApp, Boolean forceRecreate) at   Microsoft.Samples.DirectX.UtilityToolkit.Framework.CreateDevice (UInt32   adapterOridinal, Boolean windowed, Int32 suggestedWidth, Int32   suggestedHeight, IDeviceCreation callback)

The constructor managed it within a try block to handle the exception:

        try
        {
          device = new Device(
          newDeviceSettings.AdapterOrdinal,
         newDeviceSettings.DeviceType,
         this.State.WindowFocus,
         newDeviceSettings.BehaviorFlags,
        new PresentParameters[] { 
       newDeviceSettings.presentParams }
         );
         }
        catch(Exception e)
        {
       //Mostrar
        } 

All the previous parameters that the Device class receives are (as I said before) given by the UtilityToolkit.Framework classes, the most optimal configuration that this specifies is the following:

        AdapterOrdinal = 0<br>
        DeviceType = Hardware<br>
        WindowFocus = 0<br>
        BehaviorFlags = MultiThreaded, 
       HardwareVertexProcessing<br>
      PresentParameters = <br>
     {<br>
     MultiSampleQuality: 0<br>
     PresentationInterval: One<br>
       FullScreenRefreshRateInHz: 0<br>
       PresentFlag: Video<br>
       AutoDepthStencilFormat: D24X8<br>
        EnableAutoDepthStencil: True<br>
       Windowed: True<br>
        DeviceWindowHandle: 0<br>
       SwapEffect: Discard<br>
       MultiSample: None<br>
       BackBufferCount: 2<br>
       BackBufferFormat: X8R8G8B8<br>
       BackBufferHeight: 800<br>
        BackBufferWidth: 1280<br>
       ForceNoMultiThreadedFlag: True<br>

}

I have already tried to change the configuration with which the Device class is created by some of the other parameters (apart from the optimal one that is the previous one) and even then it keeps throwing me the same error.

In addition to my research on the internet, I have already verified the installation of Direct3D on the device, as well as the drivers on my card.

What could I try to do so that the Device class is created correctly?

    
asked by SL0PZ 02.04.2018 в 01:35
source

0 answers