Print Page | Close Window

CXTPSyntaxEditCtrl

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Syntax Edit
Forum Description: Topics Related to Codejock Syntax Edit
URL: http://forum.codejock.com/forum_posts.asp?TID=8813
Printed Date: 11 December 2024 at 8:57pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPSyntaxEditCtrl
Posted By: Guybrush
Subject: CXTPSyntaxEditCtrl
Date Posted: 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??



Replies:
Posted By: AndreiM
Date Posted: 17 November 2007 at 12:58pm
Please, send a piece of code where you create CXTPSyntaxEditCtrl.

-------------
Regards,
Andrei Melnik


Posted By: Guybrush
Date 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!


Posted By: Guybrush
Date 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??
 


Posted By: AndreiM
Date 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)
 


-------------
Regards,
Andrei Melnik



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net