troubleshooting Question

Assertion in appcore.cpp - why?

Avatar of tullhead
tullheadFlag for United States of America asked on
C++Editors IDEs
15 Comments2 Solutions3293 ViewsLast Modified:
My MFC App dies right away when started, due to ASSERT in the CWinApp constrcutor.  It dies in the last line of this snippet:

CWinApp::CWinApp(LPCTSTR lpszAppName)
{
      if (lpszAppName != NULL)
            m_pszAppName = _tcsdup(lpszAppName);
      else
            m_pszAppName = NULL;

      // initialize CWinThread state
      AFX_MODULE_STATE* pModuleState = _AFX_CMDTARGET_GETSTATE();
      ENSURE(pModuleState);
      AFX_MODULE_THREAD_STATE* pThreadState = pModuleState->m_thread;
      ENSURE(pThreadState);
      ASSERT(AfxGetThread() == NULL);

Now, my exe contains a built in static lib, and that static lib has in it a definition of a CWinApp subclass.  My confusion may also be conflated with the fact that I just made the leap from IDE 6.0 up to VS 2010 and I may be doing something wrong with linking in the static library.    Can someone point me where to look or give a hint as to what is likely wrong?  Thanks.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 2 Answers and 15 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 15 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros