4

You know,

there are codes like

#ifdef WPRFLAG

and

#ifdef _WINMAIN_

in ctrexe.c . I'm using vs2010)

These macros determine what function is called from entry point.

But I can't find these macros even in the macro settings of project setting.

Where teh hell are these macros defined?

skaffman
  • 398,947
  • 96
  • 818
  • 769
ssss
  • 41
  • 1
  • 4

2 Answers2

3

VS Project->Configuration properties->Linker->System->SubSystem:

  1. Console (/SUBSYSTEM:CONSOLE)
  2. Windows (/SUBSYSTEM:WINDOWS)

/SUBSYSTEM:WINDOWS this let it run into _WINMAIN_.

Nadge25
  • 317
  • 2
  • 8
WTF
  • 31
  • 2
2

WPRFLAG is defined in many wide char version of source files, such as wcrt0.c under source code folder of CRT. _WINMAIN_ is defined in Windows version of CRT source files, such as Wincrt0.c and wWincrt0.c.

Thomson
  • 20,586
  • 28
  • 90
  • 134