|
-
Sep 20th, 2003, 03:01 PM
#1
Thread Starter
Registered User
msgbox in new thread?!?!
is it possible to send paratmeters into a thread? i want to show a messagebox in another thread, and get the body of the messagebox from the oldthread , how can i do this?!
i dont want my program to stop while messagebox is shown, plz tell me how can i do it? if threading , how can i pass the body into the thread? or is there other ways
thanks,
-
Sep 20th, 2003, 04:30 PM
#2
Sleep mode
-
Sep 21st, 2003, 11:17 AM
#3
Thread Starter
Registered User
i didnt get much of the thread you linked me to, and ednees link had problems, i didnt see it, the question is can a thread access a public field of another thread?!
-
Sep 21st, 2003, 11:36 AM
#4
PowerPoster
If all you are trying to prevent is your application stopping when you show a message box, then why don't you just build a small form that looks like a message box. Then you can just show it by calling the .Show() method and not the .ShowDialog() method. This will show the new form (your custom message box) and continue executing code.
-
Sep 21st, 2003, 11:56 AM
#5
Thread Starter
Registered User
yeah , that would work for what i'm doing now, but i think i can use this thread thing later on allot, i mean its that hard to pass a parameter to a thread?
-
Sep 21st, 2003, 12:14 PM
#6
It isn' hard to pass parameters to a thread you just have to use a delegate. My site is down right now sort of (DNS hasn't switched yet) but I did post a Msgbox example at the bottom of that thread.
This is the equavilant link for now:
http://old.isharecode.com/Code/BeginInvoke.asp
Last edited by Edneeis; Sep 21st, 2003 at 12:21 PM.
-
Sep 22nd, 2003, 07:10 AM
#7
Fanatic Member
If you start a thread by:
VB Code:
Dim myThread = New Thread(New ThreadStart(AddressOf MyMethod))
myThread.Start()
Do you have to also stop it at some point?
If so, then if I use a delegate, with BeginInvoke, will the thread stop on it's own??
-
Sep 22nd, 2003, 07:21 AM
#8
Sleep mode
Originally posted by VBCrazyCoder
If you start a thread by:
VB Code:
Dim myThread = New Thread(New ThreadStart(AddressOf MyMethod))
myThread.Start()
Do you have to also stop it at some point?
If so, then if I use a delegate, with BeginInvoke, will the thread stop on it's own??
2-It's just a pointer to a method . When using BeginInvoke and you want to return a value , then use Callback EndInvoke , otherwise I don't think it's needed (it will stop on its own) .
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|