If the statement
m_pParamdisplay = new CParamDisplay;
succeedes, you do NOT call
Create
(while you
must call it).
I'd suggest something more like:
void CListTestView::OnParamDisplay()
{
m_pParamdisplay = new CParamDisplay;
if(m_pParamdisplay == NULL)
{
AfxMessageBox("Something went wrong", MB_OK|MB_ICONEXCLAMATION);
}
else
{
m_pParamdisplay->Create(ID_PARAM_DISPLAY,this);
m_pParamdisplay->ShowWindow(SW_SHOW);
}
}
BTW: Even with these modifications the code works only if
OnParamDisplay
is called just once.