when i create a window, destroy it then create it again i get error pointing to:
Code:
BOOL CGdiObject::Attach(HGDIOBJ hObject)
{
this line -> ASSERT(m_hObject == NULL); // only attach once, detach on destroy
if (hObject == NULL)
return FALSE;
CHandleMap* pMap = afxMapHGDIOBJ(TRUE); // create map if not exist
ASSERT(pMap != NULL);
pMap->SetPermanent(m_hObject = hObject, this);
return TRUE;
}
this is my code:
Code:
header file:
CCTS m_CTS;
cpp file in a menu command event:
void CChateXDlg::OnMCTS()
{
if(IsWindow(m_CTS.GetSafeHwnd()) == FALSE)
{
m_CTS.Create(IDD_CTS_DIALOG, GetDesktopWindow());
m_CTS.ShowWindow(SW_SHOW);
}
else
{
m_CTS.ShowWindow(SW_RESTORE);
m_CTS.SetForegroundWindow();
}
}
anybody know why do i get this error? Thanks.
edit: doesnt matter i fixed it