home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / os / mswindo / programm / misc / 1578 < prev    next >
Encoding:
Text File  |  1992-08-30  |  2.3 KB  |  58 lines

  1. Newsgroups: comp.os.ms-windows.programmer.misc
  2. Path: sparky!uunet!ulowell!news.bbn.com!usc!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!spaghetti.cis.ohio-state.edu!lavigne
  3. From: lavigne@spaghetti.cis.ohio-state.edu (david lavigne)
  4. Subject: Re: PETZOLD's COLOR PROGRAM AFU??
  5. Message-ID: <1992Aug30.020807.20839@cis.ohio-state.edu>
  6. Sender: news@cis.ohio-state.edu (NETnews        )
  7. Organization: The Ohio State University Dept. of Computer and Info. Science
  8. References: <1992Aug28.004811.7803@cis.ohio-state.edu>
  9. Distribution: usa
  10. Date: Sun, 30 Aug 1992 02:08:07 GMT
  11. Lines: 45
  12.  
  13. In article <1992Aug28.004811.7803@cis.ohio-state.edu> lavigne@spaghetti.cis.ohio-state.edu (david lavigne) writes:
  14. >Has anybody else had the following problem with the colors program is PETZOLDs
  15. >PROGRAMMING WINDOWS book.
  16. >
  17. >The program is not giving up some resource and will eventually cause windows to
  18. >UAE or whatever the new term is.  This happens after moving the scrollbox 
  19. >thumbs for quite a while.  Even terminating the program does not free the 
  20. >resources. 
  21. >
  22. >I have checked and double checked the code and cannott see any area from 
  23. >typing in the code, and I can't see anything obvious wrong with the 
  24. >masters code.
  25. >
  26. >I am using BC++ 3.1 and would greatly appreciate any help.
  27. >
  28. >Thanks.
  29. >David.
  30. >
  31. I have solved the problem by Calling DeleteObject with the handle returned from
  32. the SetClassWord call. (Thus Calling DeleteObject after Setting the background
  33.  brush to a new value-- Opposite of the way given in the book)
  34.  
  35. I have two ideas why this fixed the problem and I wonder
  36. If some kind soul could tell me which one it is and why.
  37.  
  38. 1. DeleteObject cannot use the value returned from GetClassWord for some reason.
  39.     (Even after various casts)
  40.  
  41. 2. The online help for DeleteObject says not to delete something that is
  42. selected into a device context.  Is the background brush in the register
  43.  class call selected into a device context by windows?
  44.  
  45. 3. For some reason, the handle for the background brush in the window class
  46. data structure cannot be used to delete the object pointed to.  
  47.  
  48. Any insights would be greatly appreciated.
  49. Thanks.
  50. David.
  51.  
  52. PS.  To the person who was in contact with me by email:
  53.     I lost your mail to me, so I could not send you these results.
  54.     Send me some more mail and well see if we can figure out why these
  55.     changes work.
  56.  
  57.  
  58.