title: Basic Windows Programming question in VS2005
body: <p>I created a win32 console application (without enable precompiled header option).
  And now my source code as this, there is two compiler errors.</p>
  <pre><code>// AFormattingMsgBox.cpp : Defines the entry point for the console application.
  //
  #include &lt;windows.h&gt;
  #include &quot;stdafx.h&quot;
  
  
  //int _tmain(int argc, _TCHAR* argv[])
  int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
                       PSTR szCmdLine, int iCmdShow)
  {
      int cxScreen, cyScreen;
  
      cxScreen = GetSystemMetrics(SM_CXSCREEN);
      cyScreen = GetSystemMetrics(SM_CYSCREEN);
  
      MessageBoxPrintf(TEXT(&quot;ScrnSize&quot;), TEXT(&quot;The screen is %i pixels wide by %i pixels high.&quot;), cxScreen, cyScreen);
  
      return 0;
  }
  
  
  int CDECL MessageBoxPrintf(TCHAR * szCaption, TCHAR * szFormat, int x, int y)
  {
      TCHAR szBuffer [1024];
      va_list pArgList;
  
      va_start(pArgList, szFormat);
  
      _vsntprintf(szBuffer, sizeof(szBuffer) / sizeof(TCHAR), 
                  szFormat, pArgList);
  
      va_end(pArgList);
  
      return MessageBox(NULL, szBuffer, szCaption, 0);
  
  }
  </code></pre>
  <p>Compiler Errors.</p>
  <blockquote>
  <p>error C3861: 'MessageBoxPrintf': identifier not found</p>
  <p>error C2365: 'MessageBoxPrintf' : redefinition; previous definition was 'formerly
  unknown identifier</p>
  </blockquote>
  <p>How can I fix the errors. Thanks for your reading and replies.</p>