Ramon Meza
Ramon Meza

Reputation: 21

D3D11CreateDeviceAndSwapChain failed (C#)

So I'm creating a program that opens up another program when you hit a button, but I have no idea what I'm doing or how to go about solving this error:

   "D3D11CreateDeviceAndSwapChain failed"

Here's the code:

    // When Launch Showroom button is pressed
    private void btn_LaunchShowroom_Click( object sender, EventArgs e )
    {
        Process.Start( GameDir + "\\acShowroom.exe" );
    }

Any help is greatly appreciated.

Upvotes: 2

Views: 532

Answers (1)

Octopoid
Octopoid

Reputation: 3688

If the application runs when you simply double click on the icon, the problem probably stems from your working directory not being set:

ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.WorkingDirectory = GameDir;
startInfo.FileName = "acShowroom.exe"
Process proc = Process.Start(startInfo);

If you have any further problems, you can probably fix them by setting more of the ProcessStartInfo properties, which you can view here.

Upvotes: 1

Related Questions