Article View: borland.public.cppbuilder.nativeapi
Article #6743Re: GDI and User Objects Overflow
From: Remy Lebeau (TeamB)
Date: Mon, 18 Apr 2005 19:46
Date: Mon, 18 Apr 2005 19:46
20 lines
1539 bytes
1539 bytes
"Mark Jacobs" <http://www.jacobsm.com/mjmsg.htm?mj@critical> wrote in
message news:4263c64a$1@newsgroups.borland.com...
> Why doesn't my code (or Windows) free up handles as it goes along?
Because your code is never freeing the icons that you retreive for each
file. You need to call DestroyIcon() after calling DrawIconEx() in order to
free the HICON.
> strcpy(bf,li->Caption.c_str());
> asico=ExtractAssociatedIcon(HInstance,bf,&icno); if (asico==NULL)
continue;
Why are you copying the Caption instead of using it directly:
asico = ExtractAssociatedIcon(HInstance, li->Caption.c_str(), &icno);
Gambit
Technical Details
Message-ID:
<42640e1c@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!newshub.sdsu.edu!tethys.csu.net!news-hog.berkeley.edu!ucberkeley!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<4263c64a$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,c7f7d55dbf4194d8 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <4263c64a$1@newsgroups.borland.com> Subject: Re: GDI and User Objects Overflow Date: Mon, 18 Apr 2005 12:46:51 -0700 Lines: 22 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 68.69.17.41 Message-ID: <42640e1c@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1113853468 68.69.17.41 (18 Apr 2005 12:44:28 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!newshub.sdsu.edu!tethys.csu.net!news-hog.berkeley.edu!ucberkeley!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail