Вопрос

So, I recently started trying to use an XNA program to start another XNA program. I've been using the normal method of "Process.Start", which works fine when opening Firefox or Media Player. However, whenever I try to start any XNA program (I've tried several), I get the error "No suitable graphics card found. Unable to create the graphics device. This program requires pixel shader 1.1 and vertex shader 1.1." I recognize this as the error when the graphics device can't handle XNA, but that's not the problem here, since I'm already running XNA to begin with.

My code currently looks like this:

System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo.FileName = Stat.clientfile;
process.StartInfo.Arguments = "";
process.StartInfo.LoadUserProfile = true;
process.StartInfo.UseShellExecute = false;
process.StartInfo.WorkingDirectory = Stat.clientfile.Remove(Stat.clientfile.Length - 1 - Stat.clientfile.Split(Convert.ToChar(@"\"))[Stat.clientfile.Split(Convert.ToChar(@"\")).Length - 1].Length);
process.StartInfo.RedirectStandardOutput = true;
Stat.MessageBox(process.StartInfo.WorkingDirectory);
process.Start();

But that's after trying just about every addition to Process.Start(filename) I could think of. I'm running XNA version 3.1 on an Acer Netbook if it means anything.

If anyone understands what's wrong with this, your help would be greatly appreciated!

Это было полезно?

Решение

I was running into the same problem. I found this thread:

http://forums.create.msdn.com/forums/p/94466/566353.aspx

Near the bottom, Kezip says "XNA didn't allow multiple programs to run while one was in full screen." Taking both programs out of fullscreen mode fixed the issue.

Другие советы

You cant use

process.StartInfo.RedirectStandardOutput = true;

with XNA Applications.

Why? The XNA Application will try to create the graphics device INSIDE the other XNA Process this way, which will 100% fail.

Dont Redirect the output and it will work. (Worked for me in 2 test szenarios with XNA 4.0 - cant say 100% if this is the same in 3.1)

EDIT:

By the way, you better use this to build your WorkingDirectory

process.StartInfo.WorkingDirectory = Stat.clientfile.Substring(0, Stat.clientfile.LastIndexOf('\\'));
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top