BCGSoft Forums
BCGSoft Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 BCGControlBar Pro for MFC Forums
 BCGControlBar Bugs and Problems
 Resource leak using CBCGPropertySheet/PropSheetLoo
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

rec

53 Posts

Posted - 07/05/2004 :  10:54:03 AM  Show Profile  Reply with Quote
I am using a CBCGPropertySheet with the PropSheetLook_OutlookBar style and it appears to be leaking some GDI resource. I am adding 12 pages to the sheet and when it is closed, there are 20+ GDI objects left in use. If I change the code to use "normal" tabs (and remove the call to SetIconList) then nothing is leaked at all.

rec

53 Posts

Posted - 07/05/2004 :  11:07:38 AM  Show Profile  Reply with Quote
I think I have found the problem - CBCGPropertySheet::InternalAddPage calls m_Icons.ExtractIcon for each page icon - and according to the MSDN, you need to free the HICON returned by ImageList_GetIcon (which ExtractIcon will call). If I comment out the call to ExtractIcon then the GDI leak goes away...

Please advise as this problem is causing me a lot of problems at the momet.
Go to Top of Page

rec

53 Posts

Posted - 07/05/2004 :  11:29:51 AM  Show Profile  Reply with Quote
The following change to CBCGPropertySheet::InternalAddPage seems to work :

if (m_wndOutlookBar.GetSafeHwnd () != NULL)
{
HICON hIcon = m_Icons.ExtractIcon (nTab);
m_wndOutlookBar.AddButton (hIcon, szTab, 0);
::DestroyIcon(hIcon);
}
Go to Top of Page

Support

3662 Posts

Posted - 07/08/2004 :  05:25:52 AM  Show Profile  Visit Support's Homepage  Reply with Quote
Thank you very much for the bug report! We'll add your fix into upcomming library release (6.34, coming soon).

Best regards,

BCGSoft Technical Support
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To:
BCGSoft Forums © Copyright (c) 1998-2017 BCGSoft Co Ltd Go To Top Of Page
Snitz Forums 2000