Print Page | Close Window

SDI app and CChartCtrl in view

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Docking Pane
Forum Description: Topics Related to Codejock Docking Pane
URL: http://forum.codejock.com/forum_posts.asp?TID=310
Printed Date: 12 May 2024 at 4:24am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: SDI app and CChartCtrl in view
Posted By: lhamel
Subject: SDI app and CChartCtrl in view
Date Posted: 19 December 2003 at 12:57pm
I have an app that I'm porting to use XTP 8.51. This SDI app has a view for a graph. I created a blank SDI app, put in the pane code, etc. but my chart doesn't get drawn to the pane. I've traced through the code some, and it appears that my chart code is being constructed properly, etc. Any ideas why it might not be drawing to the pane?

I used samples\Common\Advanced\HeroesView.h as an example. I have ChartView.h and ChartView.cpp. In CChartView::InitialUpdate(), I construct the chart object, draw some axis and labels, etc. MainFrm.cpp has the docking pane notify message, which gets called.

LRESULT CMainFrame::OnDockingPaneNotify(WPARAM wParam, LPARAM lParam)
{
if (wParam == XTP_DPN_SHOWWINDOW)
{
CXTPDockingPane* pPane = (CXTPDockingPane*)lParam;
       
if (!pPane->IsValid())
{
   switch (pPane->GetID())
   {
    case ID_PANE_CHART:
     if (m_pChartView == 0)
     {
       m_pChartView = new CChartView();
       m_pChartView->C reate(_T("STATIC"), NULL, WS_CHILD, CRect(0, 0, 0, 0), this, 0);
       ((CChartView*) m_pChartView)->OnInitialUpdate();
     }      ;     
     pPane->Attach(m_pChartView) ;
     break;
   }
   return TRUE;
}
return FALSE;
}



Replies:
Posted By: Magnetic core
Date Posted: 22 December 2003 at 3:53am

Hello lhamel,

maybe your problem comes from this line :

  m_pChartView->Create(_T("STATIC"), NULL, WS_CHILD, CRect(0, 0, 0, 0), this, 0);

I don't know your chart, but you have given a zero size (CRect(0, 0, 0, 0)), and a zero for the identifier too.

Greetings



Posted By: lhamel
Date Posted: 22 December 2003 at 3:36pm
Problem solved. The Advanced demo uses CNoFlickerWnd. I had my variables declared of that type. Once I removed it, everything worked.



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