Hello all,
I have the following Propblem.
If I Start CATIA via a Process from a C# User Form, the Space Pilot did not
work. Any suggestions
Kind regards.
Jens
Moderator: Moderators

string CATDLLPath = @"C:\Program Files\Dassault Systemes\B19_SP09\win_b64\code\bin";
string EnvironmentName = @"Catia_B19_SP09_HF0";
string ApplicationPath = @"C:\Users\Jens.Schimmelpfennig\AppData\Roaming\Test";
bool AdminMode = false;
ProcessStartInfo psi = new ProcessStartInfo("\"" + CATDLLPath + "\\CATStart.exe" + "\"");
if (!AdminMode)
{
psi.Arguments = " -run \"CNEXT.exe\" -env " + "\"" + EnvironmentName + "\"" + " -direnv " + "\"" + ApplicationPath + "\"" + " -nowindow";
}
else
{
psi.Arguments = " -run \"CNEXT.exe -admin\" -env " + "\"" + EnvironmentName + "\"" + " -direnv " + "\"" + ApplicationPath + "\"" + " -nowindow";
}
Debug.WriteLine(psi.FileName + " " + psi.Arguments);
IntPtr oCatiaHwnd= IntPtr.Zero;
bool bFound = false;
psi.UseShellExecute = false;
psi.RedirectStandardOutput = false;
psi.RedirectStandardError = true;
//Prozess starten und auf dessen Ende warten
//using (Process process = new Process())
Process process = new Process();
{
process.EnableRaisingEvents = true;
process.StartInfo = psi;
process.Start();
Application.DoEvents();
Process[] Ps = Process.GetProcesses();
int L = Ps.Length;
int timeout = 5000;
process.WaitForExit(timeout);
}

requestedExecutionLevel level="requireAdministrator" uiAccess="false"
requestedExecutionLevel level="asInvoker" uiAccess="false"
Return to Developer's Forum for Windows
Users browsing this forum: No registered users and 0 guests