Hey all,
i've got a strange problem that i can't figure out. Im using the process class to create an instance of Process, assign the StartInfo.FileName to a local file (the full path to the file) and then invoke the Start() method to start the process. right after that line i then call the waitforexit() method so my program has to wait for that process to close before it continues. Here is the code:
Code:
Dim fileProcess As New Process
Try
Me.Hide()
fileProcess.StartInfo.FileName = fileOpenPath
fileProcess.Start()
fileProcess.WaitForExit()
Catch ex as Exception
...
End Try
fileProcess.Dispose()
My problem is that, depending on the system im on, when i open a *.doc file, MS Word 03 opens up and loads the file and right after its finished loading the file and the program execution reaches the line fileProcess.WaitForExit(), the JIT compiler throws an exception stating: "No process is associated with this object." This happends on some systems and works on others (so far). What is happening here? is there something wrong with the code?