m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); Assertion Failed: at afxwin1.inl
问题 I am getting some weird error as Assert Failed f:\dd\...\include\afxwin1.inl . I am searched in Google some solutions, some solutions are for commenting this line ( m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); ) in Release mode to make it work. But after commenting that line I am getting some more errors. I have taken a dialog based MFC application. It was working absolutely fine when it was an application.exe . My requirement is to make it static library and I will have another console