home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / os / os2 / programm / 7260 < prev    next >
Encoding:
Internet Message Format  |  1992-12-31  |  2.4 KB

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