Hahahaha, i pity you man, coz you just dont know where the problem is:-D. dont worry i have been there too. just add this line at the start of the CMattDlgCmpnt::HtmlMsgBox method. AFX_MANAGE_STATE(AfxGetStaticModuleState()) if this doesnt solve ur problem, ur then on ur own. basically MFC dialogs and COM are not a good mix. u should try to use WTL or win32 way of poping a dialog. The world is becoming small and so are the people.