The following code causes a NullReferenceException
tStartParameter = String.Format(tStartParameter, tTo, tSubject)
tProcess = Process.Start(New ProcessStartInfo(tStartParameter) _
With {.UseShellExecute = True})
tProcess.WaitForExit()
tStartParameter is:
https://mail.google.com/?view=cm&fs=1&tf=1&[email protected]&su=boogaloo!!
Using the debugger I see that Process.Start is returning null. So.. any thoughts on why this is happening? I'd really like to block program execution until the user is done with the launched process.
UPDATE: Refactoring the code to this:
tStartParameter = String.Format(tStartParameter, tTo, tSubject)
tProcess = New Process
tProcess.StartInfo = New ProcessStartInfo(tStartParameter) _
With {.UseShellExecute = True}
tProcess.Start()
tProcess.WaitForExit()
causes this exception:
InvalidOperationException: No process is associated with this object.