visual c++ - What functions does _WinMainCRTStartup perform? -


This is part of a chain of at least two related closely, but there are specific questions. I hope I am doing the right thing by asking them separately.

I'm trying to get my Visual C ++ 2008 app to work without the Sea Runtime Library. It's a Win32 GUI app without MFC or other fancy stuff, just plain Windows API.

So I have the default library name in the project properties -> Configuration -> C / C ++ -> Advanced -> Yes (yes compiler flag / zll ) and rebuilding.

Then the linker complains about an unresolved external _WinMainCRTS startup . Suitable enough, I can ask the linker to use a different entry point, say MyStartup

So my question is that I gather around the web Yes, _WinMainCRTS startup does some initial stuff, and maybe I want to MyStartup . Is: What works _WinMainCRTS startup , and if I do not use CRT, which of these do I have to leave?

If you are knowledgeable about this stuff, please also take a look!

On one side: Why do I want to make it the first place?

  1. My app does not clearly
  2. I like lean and mean apps.
  3. This must teach me something new.

The entry point of the CRT does the following (this list is not complete):

  • Starts the global state required by CRT : Div class = "text" itemprop = "text">

    If this is not done, you can not use any function or state provided by the CRT.

  • Starts some global status used by the compiler, run-time checks such as the security cookie used by / GS, certainly comes out here. You can call yourself, though you may need to add other code for other run-time checks.
  • Constructors call C ++ object if you are writing C ++ code, you may need to simulate it.
  • Retrieves the command line and starts the information provided by the OS and passes it to your main. By default, no parameters are given by OS at the entry point of the program - all are proven by CRT.

The CRT source code is available with Visual Studio and you can take action through the entry point of the CRT in the debugger and find out what it is doing.


Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -