Anatoly schrieb:
Here is basically the code of New Thread:
(I've removed some of other misc settings I'm doing in pNewDocThread,
but this is the core code.)
'Start new thread.
Dim NewDocThread as New System.Threading.Thread(AddressOf pNewDocThread)
NewDocThread.Start()
Public Sub pNewDocThread()
Dim frm As New PTPApp
Application.Run(frm) 'Start new instance of App.
End Sub
Application.Run does not start a new instance. Application.run contains the
message loop keeping the Thread alive and handling the messages send to it.
This is not a new application (AKA process). It's only a new thread in the
same process.
How to pass arguments to threads:
http://msdn.microsoft.com/library/en...ingthreads.asp
(see "Passing Data To Threads")
Within the thread, don't refer to the command line arguments but to the data
passed to the thread. If you want to have only one thread work with the
command line arguments, pass the arguments only to the first thread in sub main.
Armin