![]()  | 
 
CXTPSyntaxEditCtrl | 
 
    Post Reply  
   | 
  
| Author | |
   
   Guybrush  
   
   Groupie  
   Joined: 15 October 2007 Location: Germany Status: Offline Points: 13  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Topic: CXTPSyntaxEditCtrlPosted: 17 November 2007 at 3:44am  | 
 
| 
   
    
   Hello,
 
   
  when I Create a CXTPSyntaxEditCtrl in a CXTPDockingPane, the memory of the Application is over 140MB!! 
Comment out the Lines, the Application is 18MB in Memory. 
Create a Document with CXTPSyntaxEditView, the Memory is 22MB. 
Where is the Problem?? 
    | 
 |
![]()  | 
 |
   
   AndreiM  
   
   Moderator Group  
   Joined: 18 August 2007 Status: Offline Points: 132  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 17 November 2007 at 12:58pm | 
 
| 
   
    
   Please, send a piece of code where you create CXTPSyntaxEditCtrl.
    
   
   | 
 |
![]()  | 
 |
   
   Guybrush  
   
   Groupie  
   Joined: 15 October 2007 Location: Germany Status: Offline Points: 13  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 17 November 2007 at 1:49pm | 
 
| 
   
    in the Header File 
protected :CXTPSyntaxEditCtrl m_wndEditView; 
int the cpp File: 
int CSearchResultPane::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CWnd::OnCreate(lpCreateStruct) == -1) return -1;VERIFY(m_wndToolBar.CreateToolBar(WS_TABSTOP|WS_VISIBLE|WS_CHILD|CBRS_TOOLTIPS, this));VERIFY(m_wndToolBar.LoadToolBar(IDR_PANE_SEARCHRESULT)); if (m_wndEditView.GetSafeHwnd() == 0){ if (!m_wndEditView.Create(this,TRUE,TRUE)){ TRACE0( "Unable to create Syntax Edit Ctrl.\n" ); return 0;} m_wndEditView.SetSyntaxColor(FALSE); m_wndEditView.SetLineNumbers(FALSE); m_wndEditView.SetSelMargin(FALSE); m_wndEditView.EnableVirtualSpace(FALSE); 
 
 LOGFONT lf = {0}; CFont* pFont = m_wndEditView.GetFont(); if (pFont->GetSafeHandle()){ pFont->GetLogFont(&lf); } CWindowDC dc(NULL); lf.lfHeight = -MulDiv(8,::GetDeviceCaps(dc.m_hDC, LOGPIXELSY), 72); m_wndEditView.SetFontIndirect(&lf); } return 0;} thats all! | 
 |
![]()  | 
 |
   
   Guybrush  
   
   Groupie  
   Joined: 15 October 2007 Location: Germany Status: Offline Points: 13  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 18 November 2007 at 1:52pm | 
 
| 
   
    
   Hello,
 
   
  I think the Problem is in the OnSize Function of the CXTPDockingPane 
The first Call of the OnSize is cx=65534 and cy=65534,then Resize the CXTPSyntaxEditCtrl with this large Size cx,cy. 
if (m_wndEditView.GetSafeHwnd())
 
{ m_wndEditView.MoveWindow(0, nTop, cx, cy - nTop); m_wndEditView.Invalidate(FALSE); 
} The next call is then the really Size of the Window, but the Memory of the "Large Size (65534x65534)" CXTPSyntaxEditCtrl is not Free. 
Could it be?? 
 | 
 |
![]()  | 
 |
   
   AndreiM  
   
   Moderator Group  
   Joined: 18 August 2007 Status: Offline Points: 132  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 03 December 2007 at 6:57am | 
 
| 
   
    
   I think creating such big bitmap may be a bproblem.
 
   
  Try to add check widow size condition, like:  
    if (m_wndEditView.GetSafeHwnd() && cx < 10000 && cy < 10000) 
 | 
 |
![]()  | 
 |
    Post Reply  
   | 
  |
|       
  
  Tweet   	
    | 
 
| Forum Jump | Forum Permissions  ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum  |