Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Memory Leak Problem
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Memory Leak Problem

 Post Reply Post Reply
Author
Message
sand1212 View Drop Down
Newbie
Newbie
Avatar

Joined: 29 March 2007
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote sand1212 Quote  Post ReplyReply Direct Link To This Post Topic: Memory Leak Problem
    Posted: 16 May 2007 at 1:30am
Hi,
 
I added InternalRelease(), but when I close the app it occurs access violation.
 
Message :
Detected memory leaks!
Dumping objects ->
strcore.cpp(118) : {18397} normal block at 0x02F41C70, 34 bytes long.
 Data: <            u s > 01 00 00 00 0A 00 00 00 0A 00 00 00 75 00 73 00
C:\Documents and Settings\OnFoot\My Documents\Visual Studio 2005\Projects\EOEIS\MainFrm.cpp(975) : {18396} client block at 0x02F41A08, subtype 0, 556 bytes long.
a CXTPControlGallery object at $02F41A08, 556 bytes long
Object dump complete.
 
 
Soucrce Code:
 
CXTPRibbonTab* pTabHome = pRibbonBar->AddTab(IDS_TAB_HOME);
 
 CXTPControlGallery* pControlMethod = new CXTPControlGallery(); <== this line.
 CXTPRibbonGroup* pGroupStyles = pTabHome->AddGroup(ID_METHOD_SELECT_LIST);

 pControlMethod = (CXTPControlGallery*)pGroupStyles->Add(new CXTPControlGallery(), ID_METHOD_SELECT_LIST); 
 pControlMethod->SetControlSize(CSize(408, 60)); //235
 pControlMethod->SetItemsMargin(0, 1, 0, 1);
 pControlMethod->ShowLabels(FALSE);
 pControlMethod->ShowBorders(TRUE);
 pControlMethod->SetItems(m_pItemsStyles);

 CMenu menuQuickStyles;
 menuQuickStyles.LoadMenu(IDR_METHOD_SELECT);
 
 CXTPPopupBar* pPopupBar = CXTPPopupBar::CreatePopupBar(GetCommandBars());
 pPopupBar->LoadMenu(menuQuickStyles.GetSubMenu(0));

 pControlMethod->SetCommandBar(pPopupBar);
 pPopupBar->EnableAnimation();
 pPopupBar->InternalRelease();

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 16 May 2007 at 5:52am

Change this line to

CXTPControlGallery* pControlMethod ;
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
zhuhuaizhong View Drop Down
Newbie
Newbie


Joined: 08 April 2010
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote zhuhuaizhong Quote  Post ReplyReply Direct Link To This Post Posted: 11 November 2011 at 10:36am
I got the same msg  - "memory leaks" , but in the "Ribble Sample" , the "new CXTPControlGallery(); " works well ! . It' s amazing.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.195 seconds.