This post is venting at Codejock documentation as much as it is a request for anyone with experience to tell me where I have gone wrong.
I'm using Xtreme Toolkit 18.3.0 with Visual Studio 15.7.0 on Windows 10, version 1709, build 16299.309.
I have a CXTPCalendarControl, a CXTPCalendarCaptionBarControl, and a CXTPCalendarCaptionBarTheme in a form view. They are declared in the form's header file as:
CXTPCalendarCaptionBarTheme m_oCaptionBarTheme; CXTPCalendarCaptionBarControl m_calCaptionBar; CXTPCalendarControl m_calMain;
|
In the form's OnInitialUpdate(), these calls are made:
m_oCaptionBarTheme.SetPaintTheme(xtpCalendarThemeVisualStudio2015);
m_calCaptionBar.SetTheme(&m_oCaptionBarTheme); m_calCaptionBar.EnableTimeline(FALSE); m_calCaptionBar.EnableMulticolumns(FALSE);
m_calMain.ModifyStyle(0, WS_BORDER, SWP_FRAMECHANGED); m_oCaptionBarTheme.AttachCalendar(&m_calMain); m_nDayScaleMinutes = m_calMain.GetCalendarOptions()->nDayView_ScaleInterval; OnCalendarViewWorkWeek();
CXTPCalendarDayView* pDayView = DYNAMIC_DOWNCAST(CXTPCalendarDayView, m_calMain.GetDayView()); if(pDayView) { pDayView->ScrollToWorkDayBegin(); }
SetTheme(xtpCalendarThemeVisualStudio2015);
|
The contents of SetTheme() are the same as those in Codejock's calendar demo, minus the CCalendarDemoView's view-specific calls that do not apply to this form view, such as _ResizeControls() and the scrollbar handling.
1. It appears that there are no default settings in a caption bar for a theme if the user doesn't set one. If AttachCalendar() is called without first calling CXTPCaptionBar::SetTheme(), AttachCalendar() will fail because its m_pCaptionBar pointer is null.
A default theme would be good.
2. There is some sort of declaration dependency because different types of application shutdown crashes can occur within one of those classes, depending on declaration order.
For example, if declared in the order shown above, and the caption bar theme is set as in the code above, then on app shutdown, a heap corruption exception is thrown in the CXTPCalendarCaptionBarControl's destructor on its only line of code:
CMDTARGET_RELEASE(m_pTheme);
|
I have not yet determined what the true cause of the heap corruption is.
Bob
|