home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / common / msdev98 / bin / ide / conwz.awx / TEMPLATE / ROOT.CPP < prev    next >
C/C++ Source or Header  |  1998-06-18  |  1KB  |  58 lines

  1. // $$root$$.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. $$IF(MFC)
  6. #include "$$root$$.h"
  7.  
  8. #ifdef _DEBUG
  9. #define new DEBUG_NEW
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13.  
  14. /////////////////////////////////////////////////////////////////////////////
  15. // The one and only application object
  16.  
  17. CWinApp theApp;
  18.  
  19. using namespace std;
  20.  
  21. int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
  22. {
  23.     int nRetCode = 0;
  24.  
  25.     // initialize MFC and print and error on failure
  26.     if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
  27.     {
  28.         // TODO: change error code to suit your needs
  29.         cerr << _T("Fatal Error: MFC initialization failed") << endl;
  30.         nRetCode = 1;
  31.     }
  32.     else
  33.     {
  34.         // TODO: code your application's behavior here.
  35.         CString strHello;
  36.         strHello.LoadString(IDS_HELLO);
  37.         cout << (LPCTSTR)strHello << endl;
  38.     }
  39.  
  40.     return nRetCode;
  41. }
  42. $$ENDIF
  43.  
  44. $$IF(HELLO)
  45. int main(int argc, char* argv[])
  46. {
  47.     printf("Hello World!\n");
  48.     return 0;
  49. }
  50. $$ENDIF
  51.  
  52. $$IF(SIMPLE)
  53. int main(int argc, char* argv[])
  54. {
  55.     return 0;
  56. }
  57. $$ENDIF
  58.