Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When running a program using Process.Start, it can't find it's resource files

i have this code:

private void button1_Click(object sender, EventArgs e)
{
    Process p = new Process();
    p.StartInfo.FileName = "C:/Users/Valy/Desktop/3dcwrelease/3dcw.exe";
    p.Start();
}

3dcw.exe is an app for OpenGL graphics.

The problem is that when I click on the button, the executable file runs, but it can't access its texture files.

Does anyone have a solution? I think something like loading the bitmap files in the background, then running the exe file, but how can i do that?

like image 837
Din Ionuț Valentin Avatar asked Mar 31 '26 04:03

Din Ionuț Valentin


1 Answers

I've searched on the internet for a solution at your problem and found this site: http://www.widecodes.com/0HzqUVPWUX/i-am-lauching-an-opengl-program-exe-file-from-visual-basic-but-the-texture-is-missing-what-is-wrong.html

In C# code it looks something like this:

string exepath = @"C:\Users\Valy\Desktop\3dcwrelease\3dcw.exe";
ProcessStartInfo psi = new ProcessStartInfo();
psi.FileName = exepath;
psi.WorkingDirectory = Path.GetDirectoryName(exepath);
Process.Start(psi);
like image 66
Dana Avatar answered Apr 02 '26 18:04

Dana



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!