Hi all,
I have a situation where I'm using BackgroundWorke r to run a long process in the background. However, whenever it runs I keep getting the following error:
The culprit seems to be this guy:
In my DoWork sub I'm calling a sub in another module. The above line is in the middle of that other sub. I'm using Process.Start to run a Matlab executable file (not written by me) that processes an image and spits out a number.
I tried putting the Dim statement outside the sub, but then it just gives me the same error a couple of lines down when I try to set the .StartInfo properties.
Does the "was unhandled" part of the above exception mean that I need to provide some kind of error checking (maybe a try...catch), or does it mean that I'm not allowed to do a Process.Start from within a BackgroundWorke r thread?
I'm pretty new to threading in general, so any help would be greatly appreciated. Code examples would be very helpful, since I'm not a programmer by nature and can't always make heads or tails out of what I read in the Microsoft Documentation.
Please also let me know if you need any additional info.
Thanks for your time!
I have a situation where I'm using BackgroundWorke r to run a long process in the background. However, whenever it runs I keep getting the following error:
"TargetInvocati onException was unhandled"
The culprit seems to be this guy:
Code:
Dim GrainProcess As New Process()
I tried putting the Dim statement outside the sub, but then it just gives me the same error a couple of lines down when I try to set the .StartInfo properties.
Does the "was unhandled" part of the above exception mean that I need to provide some kind of error checking (maybe a try...catch), or does it mean that I'm not allowed to do a Process.Start from within a BackgroundWorke r thread?
I'm pretty new to threading in general, so any help would be greatly appreciated. Code examples would be very helpful, since I'm not a programmer by nature and can't always make heads or tails out of what I read in the Microsoft Documentation.
Please also let me know if you need any additional info.
Thanks for your time!

Comment