home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!pipex!demon!man0507.wins.icl.co.uk!I.T.Marsh
- Newsgroups: comp.os.ms-windows.programmer.misc
- From: I.T.Marsh@man0507.wins.icl.co.uk (I.T.Marsh)
- X400-Received: by mta eros.uknet.ac.uk in /PRMD=UK.AC/ADMD=GOLD 400/C=GB/;
- Relayed; Tue, 1 Sep 1992 12:07:07 +0100
- X400-Received: by /PRMD=icl/ADMD=gold 400/C=GB/; converted (ia5); Relayed;
- Tue, 1 Sep 1992 12:00:05 +0100
- X400-Originator: I.T.Marsh@man0507.wins.icl.co.uk
- X400-MTS-Identifier: [/PRMD=icl/ADMD=gold 400/C=GB/;man0507 0000006700000047]
- Original-Encoded-Information-Types: undefined
- X400-Content-Type: P2-1984 (2)
- Content-Identifier: 47
- Subject: re: PETZOLD's COLOR PROGRAM AFU??
- Date: Tue, 1 Sep 1992 11:18:21 +0000
- Message-ID: <MNEWS.715346301.20143@gate.demon.co.uk>
- Sender: usenet@gate.demon.co.uk
- Lines: 64
-
-
-
-
-
-
-
- In article <1992Aug28.004811.7803@cis.ohio-state.edu> lavigne@spaghetti.cis.ohio
-
- -state.edu (david lavigne) writes:
- >>Has anybody else had the following problem with the colors program is PETZOLDs
-
- >>PROGRAMMING WINDOWS book.
- >>
- >>The program is not giving up some resource and will eventually cause windows t
- o
-
- >>UAE or whatever the new term is. This happens after moving the scrollbox
- >>thumbs for quite a while. Even terminating the program does not free the
- >>resources.
- >>
- >>I have checked and double checked the code and cannott see any area from
- >>typing in the code, and I can't see anything obvious wrong with the
- >>masters code.
- >
- >>I am using BC++ 3.1 and would greatly appreciate any help.
- >
- >>Thanks.
- >>David.
- >
- >I have solved the problem by Calling DeleteObject with the handle returned from
-
- >the SetClassWord call. (Thus Calling DeleteObject after Setting the background
- > brush to a new value-- Opposite of the way given in the book)
-
- >I have two ideas why this fixed the problem and I wonder
- >If some kind soul could tell me which one it is and why.
-
- >1. DeleteObject cannot use the value returned from GetClassWord for some reason
- .
-
- > (Even after various casts)
-
- >2. The online help for DeleteObject says not to delete something that is
- >selected into a device context. Is the background brush in the register
- > class call selected into a device context by windows?
-
- >3. For some reason, the handle for the background brush in the window class
- >data structure cannot be used to delete the object pointed to.
-
- >Any insights would be greatly appreciated.
- >Thanks.
- >David.
-
- Thanks David, for the info provided above. We have had trouble tracking a
- memory leak and it turned out that the problem above was one of the main
- culprits. The solution worked for us too.
-
- I have found, however, that I can't recreate this problem when I run my
- program or the colors program from Petzold under Windows 3.0. The problem
- happens every time under Windows 3.1. This would tend to suggest that our
- friends Microsoft have made some sort of underlying change with the release
- of Windows 3.1. (I am using Borland 3.0).
-
- Thanks again, Tom.
-