Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 14th, 2009, 05:25 AM
kool26 kool26 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2009
Posts: 1 kool26 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 m 3 sec
Reputation Power: 0
Code not working - ExtractIcon leaks

Hi Guys,

I am trying to place an Icon on VSFlexgrid cell (using ImageList). Below is the code sample for it:
Dim mImageList as ImageList
Dim hIcon As Long
hIcon = mImageList.ListImages(1).ExtractIcon
mGrid.Cell(flexcpPicture, key) = hIcon

This ExtractIcon on ListImage leaks as it always creates a new instance. When I try to destroy the icon using DestroyIcon it removes the GDI leak but also removes the icon from the flexgrid. So I don't see any icon. Below is the sample code:

Dim mImageList as ImageList
Dim hIcon As Long
hIcon = mImageList.ListImages(1).ExtractIcon
mGrid.Cell(flexcpPicture, key) = hIcon

DestroyIcon hIcon

So I thought converting this Icon to StdPicture and then place it on flexgrid. In that way I can destroy the icon and use the picture on the cell.

Dim mImageList as ImageList
Dim hIcon As Long
Dim pic As New StdPicture
hIcon = mImageList.ListImages(Status).ExtractIcon
Set pic = ConvertIconToHandle(hIcon)
mGrid.Cell(flexcpPicture, mGrid.FindRow(mstrKey)) = pic

DestroyIcon hIcon

So there is no leak with StdPicture but I still can't see any icon on flexgrid. Any help will be appreciated.

Reply With Quote
  #2  
Old January 23rd, 2012, 01:12 PM
Inquizitor Inquizitor is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2011
Posts: 13 Inquizitor Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 2 h 56 m 20 sec
Reputation Power: 0
try deleaker or similar debugger for GDI leaks...

Reply With Quote
  #3  
Old February 9th, 2012, 01:45 PM
Inquizitor Inquizitor is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2011
Posts: 13 Inquizitor Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 2 h 56 m 20 sec
Reputation Power: 0
I think you've already decided your problem

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Code not working - ExtractIcon leaks

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap