Here's the code that I call from the SocketReceiveCallback routine...
Delegate Sub ToChatWindowDelegate(ByVal msg As String)
Dim ChatDelegate As New ToChatWindowDelegate(AddressOf ToChatWindow)
Dim ChatObject(0) As Object
Private Sub ToChatWindow(ByVal msg As String)
If msg = "" Then Exit Sub
If txtChat.InvokeRequired Then
ChatObject(0) = msg
txtChat.Invoke(ChatDelegate, ChatObject)
Else
txtChat.AppendText(msg)
End If
End Sub
Here's the code for the LinkClicked event
Private Sub txtChat_LinkClicked(ByVal sender As Object, ByVal e As
System.Windows.Forms.LinkClickedEventArgs) Handles txtChat.LinkClicked
Dim pi As New ProcessStartInfo(e.LinkText)
Process.Start(pi)
End Sub
What I'm wondering is what is the difference between using
pi.UseShellExecute=True and pi.UseShellExecute=False?
Which is better when all you want is to spawn an IE instance and get back as
quickly as possible?
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
"Terry Olsen" <to******@hotmail.com> schrieb: When starting a process, what is the difference between using
ShellExecute or not using it?
What's the alternative? Not starting anything or using an alternate
method to start the application? I recommend to use
'System.Diagnostics.Process.Start' instead of p/invoke with the
'ShellExecute' function.
I need to start IE when a link is clicked in my app. I want as little
impact to my app as possible. What is the best method for this?
In my case I have it working in a chat application. I use a RTB so that
the links are detected. I click on the link and IE opens without
problem 99% of the time.
If a link is clicked at the exact moment text is being appended to the
RTB, the app crashes with a threading error.
Are you adding the text to the textbox from another thread? Are you sure
you are using 'Control.{Invoke, BeginInvoke, InvokeRequired}' to access
the control from the other thread instead of accessing it directly?
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>