Advertisement
Guest User

Untitled

a guest
Feb 4th, 2011
862
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.85 KB | None | 0 0
  1. // Test.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "Test.h"
  6.  
  7. #ifdef _DEBUG
  8. #define new DEBUG_NEW
  9. #endif
  10.  
  11.  
  12. // The one and only application object
  13.  
  14. CWinApp theApp;
  15.  
  16. using namespace std;
  17.  
  18. int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
  19. {
  20.     int nRetCode = 0;
  21.  
  22.     HMODULE hModule = ::GetModuleHandle(NULL);
  23.  
  24.     if (hModule != NULL)
  25.     {
  26.         // initialize MFC and print and error on failure
  27.         if (!AfxWinInit(hModule, NULL, ::GetCommandLine(), 0))
  28.         {
  29.             // TODO: change error code to suit your needs
  30.             _tprintf(_T("Fatal Error: MFC initialization failed\n"));
  31.             nRetCode = 1;
  32.         }
  33.         else
  34.         {
  35.             // TODO: code your application's behavior here.
  36.  
  37.             cout << 10 << endl;
  38.         }
  39.     }
  40.     else
  41.     {
  42.         // TODO: change error code to suit your needs
  43.         _tprintf(_T("Fatal Error: GetModuleHandle failed\n"));
  44.         nRetCode = 1;
  45.  
  46.        
  47.     }
  48.  
  49.     return nRetCode;
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement