Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Docking Pane
  New Posts New Posts RSS Feed - SDI app and CChartCtrl in view
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

SDI app and CChartCtrl in view

 Post Reply Post Reply
Author
Message
lhamel View Drop Down
Newbie
Newbie


Joined: 17 December 2003
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote lhamel Quote  Post ReplyReply Direct Link To This Post Topic: SDI app and CChartCtrl in view
    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;
}
Back to Top
Magnetic core View Drop Down
Newbie
Newbie
Avatar

Joined: 22 August 2003
Location: Switzerland
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote Magnetic core Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
lhamel View Drop Down
Newbie
Newbie


Joined: 17 December 2003
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote lhamel Quote  Post ReplyReply Direct Link To This Post 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.
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.203 seconds.