home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!news.acns.nwu.edu!uicvm.uic.edu!u37127
- Organization: University of Illinois at Chicago
- Date: Thursday, 31 Dec 1992 11:00:46 CST
- From: <U37127@uicvm.uic.edu>
- Message-ID: <92366.110046U37127@uicvm.uic.edu>
- Newsgroups: comp.os.os2.programmer
- Subject: Re: Dialogs + Threads = Problems. Help!
- References: <92365.153701U37127@uicvm.uic.edu>
- <1992Dec31.151448.17833@panix.com>
- Lines: 47
-
- In article <1992Dec31.151448.17833@panix.com>, os2man@panix.com (Larry Salomon
- Jr.) says:
- >
- >In <92365.153701U37127@uicvm.uic.edu> <U37127@uicvm.uic.edu> writes:
- >
- >>Hello all,
- >
- >> I have been having some weird PM problems that I was hoping someone could
- >> shed some light on. Basically the problem is that if I start a thread
- >> from a dialog, and then from within the thread try to send messages to
- >> the dialog items, or set DlgItemText, the calls fail. I have not omitted
- >> the all important step of getting a PM anchor block handle for each thread.
- >
- >But you did omit the creation of a message queue for the other thread. Also,
-
- By the other thread, do you mean the thread issuing the WinSendMsg?
- The thread owning the dialog is thread 1, so it does have a msg queue.
- I have received E-mail (rob@cc.gatech.edu) saying that the thread
- issuing the WinSendMsg must have a msg Q as well; I also received
- another answer saying that a thread *cannot* use WinSendMsg
- to a window belonging to another thread (lhoang@orion.uci.edu) and
- that this behaviour is documented. Apparently IBM recommends
- WinPostMsg. Perhaps to maintain serialization via the msg Q
- as opposed to WinSendMsg which is a direct call to the function?
-
- Is there a definitve doc anywhere on this subject? My interim kludge has been
- to use WinPostMsg, with an app defined msg, and block until the receiver
- processes the msg and shoves the result into a shared data structure.
-
- If you can let me know where this behavior is documented, I wont bug the net
- in the future!!!
-
- >it is highly recommended that all threads but the one with the message loop
- >call WinCancelShutdown(); if anyone wants to know the specifics of why, send
- >me email.
-
- I would like to know why... Thank you all for your help!
-
- Satish
-
- >
- >Cheers,
- >Q
- >--
- >"If you choose not to decide, you | "My other body is in the shop" - seen
- > still have made a choice" - Rush | on a T-shirt
- >------------------------------------------------------------------------
-