C + + Startup function startup

Source: Internet
Author: User

__declspec (noinline) int__tmaincrtstartup (void) {int initret;        int mainret=0;        int managedapp; #ifdef _winmain_ _tuchar *lpszcommandline;        Startupinfow Startupinfo; Getstartupinfow (&startupinfo), #endif/* _winmain_ */#ifdef _m_ix86 * * * Enable app termination when Heap corruption is detected on * Windows Vista and above.         This was a no-op on Down-level OS ' s * and enabled by default for 64-bit processes. */if (!_noheapenableterminationoncorruption) {heapsetinformation (NULL, Heapenableterminationonc        Orruption, NULL, 0); } #endif/* _m_ix86 */* * Determine if this is a managed application */Managedapp = check        _managed_app ();  if (!_heap_init ())/* Initialize heap */fast_error_exit (_rt_heapinit); /* Write Message and die */if (!_mtinit ())/* Initialize Multi-thread*/Fast_error_exit (_rt_thread); /* Write Message and die */* Enable buffer count checking if linking against static Lib */_crtsetcheckcou        NT (TRUE);        /* * Initialize the Runtime Checks stuff */#ifdef _RTC _rtc_initialize (); #endif/* _RTC */  /* Guard The remainder of the initialization code and the call * to user's main, or WinMain, function in         A __try/__except * statement. */__try {if (_ioinit () < 0)/* Initialize LOWIO */_amsg_exit (_rt_lowio            INIT);            /* Get wide cmd line info */_tcmdln = (_tschar *) getcommandlinet ();            /* Get wide environ info */_tenvptr = (_tschar *) getenvironmentstringst ();            if (_TSETARGV () < 0) _amsg_exit (_rt_spacearg);            if (_TSETENVP () < 0) _amsg_exit (_rt_spaceenv);                Initret = _cinit (TRUE);  /* Do C Data Initialize */if (Initret! = 0) _amsg_exit (initret); #ifdef _winmain_ L            pszCommandLine = _twincmdln ();                                 Mainret = _tWinMain ((hinstance) &__imagebase, WinMain function NULL,                                      Lpszcommandline, Startupinfo.dwflags & Startf_useshowwindow ? StartupInfo.wShowWindow:SW_SHOWDEFAULT); #else/* _            Winmain_ */_tinitenv = _tenviron;   Mainret = _tmain (__ARGC, _TARGV, _tenviron);                             Here is the real main function #endif/* _winmain_ */if (!managedapp) exit (Mainret);                                      Call the Exit Function _cexit () after execution is complete;             Do the Aftercare} __except (_xcptfilter (GetExceptionCode (), GetExceptionInformation ())) {/* * Should NevER reach here */Mainret = GetExceptionCode ();            if (!managedapp) _exit (Mainret);        _c_exit (); }/* End of Try-except */return Mainret;}

C + + Startup function startup

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.