Hi,
I've a class called CChartCtrl which i used it to draw graphs.
The graphs that i drew is in a Custom Control in the parent dialog. I've a button called "Full-Screen".
When i clicked on the full screen button, I passed the Custom control to the new dialog in Full-screen.
When i tried to restore to the parent dialog, it will give me error.
CChartCtrl m_ChartCtrl;
CFullScreen m_pFullScr;
void CParentDialog::OnBnClickedButtonFullscr()
{
m_pFullScr.SetChartCtrl(&m_ChartCtrl);
}
CChartCtrl* m_maxChartCtrl;
void CFullScreen::SetChartCtrl(CChartCtrl* ChartCtrl)
{
m_maxChartCtrl = ChartCtrl;
}
In Full-Screen On-Init Dialog:
m_maxChartCtrl->SetParent(this);
When I clicked the restore screen button:
CParentDlg *dlg = (CParentDlg *) this->GetParent();
dlg->SetChartCtrl(m_maxChartCtrl);
In Parent Dialog:
CChartCtrl m_ChartCtrl;
void CParentDlg::SetChartCtrl(CChartCtrl ChartCtrl)
{
m_ChartCtrl = ChartCtrl; }
if(m_pFullScr.DoModal() == IDOK)
{
m_ChartCtrl.SetParent(this);
}
I will receive this error:
error C2582: 'operator =' function is unavailable in 'CChartCtrl'
CChartCtrl is derived from CWnd.
Am i doing anything wrong? Any help is greatly appreciated. Thank you.