The Artima Developer Community
Sponsored Link

.NET Buzz Forum
Entrypoint & CRT startup

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Adrian Florea

Posts: 206
Nickname: adrian11
Registered: Jul, 2004

Adrian Florea is a .NET developer from Italy
Entrypoint & CRT startup Posted: Oct 14, 2005 5:33 AM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Adrian Florea.
Original Post: Entrypoint & CRT startup
Feed Title: Web Log di Adrian Florea
Feed URL: /error.aspx?aspxerrorpath=/adrian/Rss.aspx
Feed Description: "You know you've achieved perfection in design, not when you have nothing more to add, but when you have nothing more to take away." Antoine de Saint-Exupery
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Adrian Florea
Latest Posts From Web Log di Adrian Florea

Advertisement

Se in C# questo snippet:

using System;
using System.Reflection;
 
class Foo
{
      static void Main()
      {
            Console.WriteLine(Assembly.GetEntryAssembly().EntryPoint.Name);
      }
}

stampa Main a console, non la stessa cosa si può dire dell'equivalente C++:

using namespace System;
using namespace System::Reflection;
 
void main()
{
    Console::WriteLine(Assembly::GetEntryAssembly()->EntryPoint->Name);
}

che stampa a console:

  • main
  • mainCRTStartup oppure
  • _mainCRTStartup

in base alle opzioni:

  • /clr:safe
  • /clr:pure rispettivamente
  • /clr:oldSyntax (oppure /clr:initialAppDomain)

dove mainCRTStartup e _mainCRTStartup sono funzioni di C/C++ run-time startup. Il compilatore (tranne nel caso /clr:safe) chiama prima queste funzioni per le inizializzazioni necessarie alla C/C++ run-time library (variabili globali, heap, etc) e quindi saranno loro quelle decorate con .entrypoint in IL e non il metodo main dello snippet. L'opzione /clr:safe invece, produce codice verificabile e non offre supporto CRT e quindi niente stub.

Read: Entrypoint & CRT startup

Topic: NSurvey - free web based survey Previous Topic   Next Topic Topic: MCMS FAQ update

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use