home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / os / mswindo / programm / misc / 1614 < prev    next >
Encoding:
Internet Message Format  |  1992-09-01  |  2.9 KB

  1. Path: sparky!uunet!pipex!demon!man0507.wins.icl.co.uk!I.T.Marsh
  2. Newsgroups: comp.os.ms-windows.programmer.misc
  3. From: I.T.Marsh@man0507.wins.icl.co.uk (I.T.Marsh)
  4. X400-Received: by mta eros.uknet.ac.uk in /PRMD=UK.AC/ADMD=GOLD 400/C=GB/;
  5.                Relayed; Tue, 1 Sep 1992 12:07:07 +0100
  6. X400-Received: by /PRMD=icl/ADMD=gold 400/C=GB/; converted (ia5); Relayed;
  7.                Tue, 1 Sep 1992 12:00:05 +0100
  8. X400-Originator: I.T.Marsh@man0507.wins.icl.co.uk
  9. X400-MTS-Identifier: [/PRMD=icl/ADMD=gold 400/C=GB/;man0507 0000006700000047]
  10. Original-Encoded-Information-Types: undefined
  11. X400-Content-Type: P2-1984 (2)
  12. Content-Identifier: 47
  13. Subject: re: PETZOLD's COLOR PROGRAM AFU??
  14. Date: Tue, 1 Sep 1992 11:18:21 +0000
  15. Message-ID: <MNEWS.715346301.20143@gate.demon.co.uk>
  16. Sender: usenet@gate.demon.co.uk
  17. Lines: 64
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25. In article <1992Aug28.004811.7803@cis.ohio-state.edu> lavigne@spaghetti.cis.ohio
  26.  
  27. -state.edu (david lavigne) writes:
  28. >>Has anybody else had the following problem with the colors program is PETZOLDs
  29.  
  30. >>PROGRAMMING WINDOWS book.
  31. >>
  32. >>The program is not giving up some resource and will eventually cause windows t
  33. o
  34.  
  35. >>UAE or whatever the new term is.  This happens after moving the scrollbox
  36. >>thumbs for quite a while.  Even terminating the program does not free the
  37. >>resources.
  38. >>
  39. >>I have checked and double checked the code and cannott see any area from
  40. >>typing in the code, and I can't see anything obvious wrong with the
  41. >>masters code.
  42. >
  43. >>I am using BC++ 3.1 and would greatly appreciate any help.
  44. >
  45. >>Thanks.
  46. >>David.
  47. >
  48. >I have solved the problem by Calling DeleteObject with the handle returned from
  49.  
  50. >the SetClassWord call. (Thus Calling DeleteObject after Setting the background
  51. > brush to a new value-- Opposite of the way given in the book)
  52.  
  53. >I have two ideas why this fixed the problem and I wonder
  54. >If some kind soul could tell me which one it is and why.
  55.  
  56. >1. DeleteObject cannot use the value returned from GetClassWord for some reason
  57. .
  58.  
  59. >        (Even after various casts)
  60.  
  61. >2. The online help for DeleteObject says not to delete something that is
  62. >selected into a device context.  Is the background brush in the register
  63. > class call selected into a device context by windows?
  64.  
  65. >3. For some reason, the handle for the background brush in the window class
  66. >data structure cannot be used to delete the object pointed to.
  67.  
  68. >Any insights would be greatly appreciated.
  69. >Thanks.
  70. >David.
  71.  
  72. Thanks David, for the info provided above. We have had trouble tracking a
  73. memory leak and it turned out that the problem above was one of the main 
  74. culprits. The solution worked for us too.
  75.  
  76. I have found, however, that I can't recreate this problem when I run my
  77. program or the colors program from Petzold under Windows 3.0. The problem
  78. happens every time under Windows 3.1. This would tend to suggest that our
  79. friends Microsoft have made some sort of underlying change with the release
  80. of Windows 3.1. (I am using Borland 3.0).
  81.  
  82. Thanks again, Tom.
  83.