Can not start ext. programm??

peroja

Member
Joined
May 16, 2012
Messages
7
Programming Experience
1-3
Hello

I have a Strange issue. I have two programms which i have to start. Both programms are Flight Simulator Remote Controll programms to controll hardware (real instruments)

I do it this way:

VB.NET:
Imports System.Threading

Public Class Form1
    ' Get a handle to an application window.
    Declare Auto Function FindWindow Lib "USER32.DLL" ( _
        ByVal lpClassName As String, _
        ByVal lpWindowName As String) As IntPtr
    ' Activate an application window.
    Declare Auto Function SetForegroundWindow Lib "USER32.DLL" _
        (ByVal hWnd As IntPtr) As Boolean
    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        Dim localByName As Process() = Process.GetProcessesByName("fsx")
        Dim stopwatch As Stopwatch = stopwatch.StartNew
        Dim p As New Process()


        If localByName.Length = "0" Then

            MsgBox("FSX läuft nicht")
        ElseIf localByName.Length = "1" Then
            p.StartInfo.FileName = "C:\TRC Software\TRCUSBFsLink.exe"
            p.StartInfo.WindowStyle = ProcessWindowStyle.Normal
            p.Start()
            
        End If

        Me.Close()
    End Sub
End Class

The Problem is, it causes me a Error: "Pleaser, report unhandled exeption - .\TRCDev.dll"

But when i start the programm directly, there is no problem at all.
I also tried to start the Programm with the "Shell" command. Same result.

This Error ocures only in ONE of these two programms. The other programm i can start without problems. (same folder, same provider)

Any Idea what this could be?

Thanks
 
No. What gave you that impression?
 
You have set WorkingDirectory property to correct path and that didn't help?
 
Back
Top