title: Simple Display Window program is giving error VS2012
body: <pre><code>#include&lt;afxwin.h&gt;
  #include"stdafx.h"
  
  class CSimpleFrame : public CFrameWnd
  {
      public:
      CSimpleFrame()
      {
          Create(NULL,L"Windows Application");
      }       
  
  };
  
  struct CSimpleApp : public CWinApp
  {
       BOOL InitInstance()
      {
          CSimpleFrame *Tester= new CSimpleFrame();
          m_pMainWnd=Tester;
  
          m_pMainWnd-&gt;ShowWindow(SW_SHOW);
          m_pMainWnd-&gt;UpdateWindow();
  
          return TRUE;
      }
  
  
  };
  
  CSimpleApp theApp;
  </code></pre>
  
  <p>This program is for displaying a simple window in vs2012.
  Clearly i am new to windows programming.Also This error started coming after I created the global object theApp.</p>
  
  <p>The error I am getting is the following.</p>
  
  <pre><code>    Debug Assertion Failed!
      Program: C:\Windows\system32\mfc110ud.dll
      File: f:\\dd\vctools\vc7libs\ship\atlmfc\src\mfc\appcore.cpp
      Line: 196
  
      **line 196 of appcore.cpp is**
      ASSERT(AfxGetThread() == NULL);
      When this error is shown i press retry.And then i press break and then continue then it gives another error
      Debug Assertion Failed!
      Program: C:\Windows\system32\mfc110ud.dll
      File: f:\\dd\vctools\vc7libs\ship\atlmfc\src\mfc\appcore.cpp
      Line: 203
  
      **line 203 of appcore.cpp is** 
      ASSERT(afxCurrentWinApp == NULL); // only one CWinApp object please
  </code></pre>