SDI app and CChartCtrl in view |
Post Reply |
Author | |
lhamel
Newbie Joined: 17 December 2003 Status: Offline Points: 2 |
Post Options
Thanks(0)
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; } |
|
Magnetic core
Newbie Joined: 22 August 2003 Location: Switzerland Status: Offline Points: 8 |
Post Options
Thanks(0)
|
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 |
|
lhamel
Newbie Joined: 17 December 2003 Status: Offline Points: 2 |
Post Options
Thanks(0)
|
Problem solved. The Advanced demo uses CNoFlickerWnd. I had my variables declared of that type. Once I removed it, everything worked.
|
|
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 |