BCGSoft Forums
BCGSoft Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 BCGControlBar Pro for MFC Forums
 BCGControlBar Professional Edition
 Chart - Advanced Legend
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

MtAg11

5 Posts

Posted - 07/28/2014 :  3:45:23 PM  Show Profile  Reply with Quote
I am trying to update and change the chart type based on some outside considerations and the chart is crashing within the advanced legend. I have been able to replicate the crash in the chart example. To replicate it - follow the steps.

1) Download example found here (https://www.dropbox.com/s/s4conw78a7a7rvg/BCGPChartExample.zip)
2) Open Chart Example
3) Select "Chart Advanced Legend"
4) Type "Test" (without quotes), in the legend title field.
5) See crash.

The reason that I need this is that I have a chart that I need to build a custom legend around. I have implemented the code in a similar fashion and it works fine until we update or refresh the view. I am getting the same exact call stack crash within out applications code as the one found here.

Any help would be extremely appreciated. I will remove once the demo once a reply has been given.

Support

4187 Posts

Posted - 07/29/2014 :  04:02:14 AM  Show Profile  Visit Support's Homepage  Reply with Quote
Hello,

Thank you for contacting us!

You may delete this file - we got it.

The valid code should be:
void CChartAdvancedLegendView::OnUpdateLegendName() 
{
	UpdateData();
	
	ASSERT_VALID(m_pLegend);
	m_pLegend->ShowLegendTitle(m_bShowLegendTitle, m_strLegendName);

	m_pLegend->RemoveRelatedChart(m_pChart1);
	m_pLegend->RemoveRelatedChart(m_pChart2);
	
	if( m_strLegendName == _T("Test") )
	{
		m_pChart1->SetChartType(BCGPChartLine3D);
	}
	else
	{
		m_pChart1->SetChartType(BCGPChartLine);
	}
	
	OnUpdate();
	Repos();
}

m_pLegend->RemoveRelatedChart cleanups the data associated with the chart and OnUpdate adds it again.

Best regards,

BCGSoft Technical Support
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To:
BCGSoft Forums © Copyright (c) 1998-2022 BCGSoft Co Ltd Go To Top Of Page
Snitz Forums 2000