CRT Entry Points

Other versions of this page are also available for the following:
Windows Mobile Not SupportedWindows Embedded CE Supported

When you link your image, you explicitly or implicitly specify an entry point that the operating system will call into after loading the image.

For a DLL, the default entry point is _DllMainCRTStartup.

For an EXE, the default entry is wWinMainCRTStartup, the Unicode entry point for an EXE that defines the wWinMain function, or WinMainCRTStartup otherwise.

You can rely on the default entry point that the linker chooses, but the best practice is usually to override the default choice. Instead, specify an entry point with the /ENTRY linker option.

Windows Embedded CE supports the following CRT entry points:

  • mainACRTStartup for applications that define the main function
  • mainWCRTStartup for applications that define the wmain function
  • WinMainCRTStartup for applications that define the WinMain function
  • wWinMainCRTStartup for applications that define the wWinMain function
  • _DllMainCRTStartup for DLLs

For more information, see the Visual Studio linker topic /ENTRY (Entry-Point Symbol).

If you want to use mainACRTStartup or mainWCRTStartup, you must explicitly state that when you specify the /ENTRY option.

Community Additions