Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Syntax Edit
  New Posts New Posts RSS Feed - CXTPSyntaxEditCtrl
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPSyntaxEditCtrl

 Post Reply Post Reply
Author
Message
Guybrush View Drop Down
Groupie
Groupie


Joined: 15 October 2007
Location: Germany
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote Guybrush Quote  Post ReplyReply Direct Link To This Post Topic: CXTPSyntaxEditCtrl
    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??
Back to Top
AndreiM View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 18 August 2007
Status: Offline
Points: 132
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndreiM Quote  Post ReplyReply Direct Link To This Post Posted: 17 November 2007 at 12:58pm
Please, send a piece of code where you create CXTPSyntaxEditCtrl.
Back to Top
Guybrush View Drop Down
Groupie
Groupie


Joined: 15 October 2007
Location: Germany
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote Guybrush Quote  Post ReplyReply Direct Link To This Post 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!
Back to Top
Guybrush View Drop Down
Groupie
Groupie


Joined: 15 October 2007
Location: Germany
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote Guybrush Quote  Post ReplyReply Direct Link To This Post 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??
 
Back to Top
AndreiM View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 18 August 2007
Status: Offline
Points: 132
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndreiM Quote  Post ReplyReply Direct Link To This Post 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)
 
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.156 seconds.