Yes, may be that I've assigned variables to controls and later removed from the resource!!! (Is that a problem ????). The debugger say that there are problems on the global theApp here: BOOL CVivoliApp::InitInstance() #ifdef _AFXDLL Enable3dControls(); #else Enable3dControlsStatic(); #endif CVivoliDlg dlg; --->> m_pMainWnd = &dlg; int nResponse = dlg.DoModal(); if (nResponse == IDOK) { // ,,,,,,,, } else if (nResponse == IDCANCEL) { // ...... } }