The Main Problem

Author: (Norbert) Suedland, Aalen, Germany

The first problem when getting started is: How can a program be made run?

Indeed, there are several possibilities to start a C program under Windows:

  1. The usual function main (main_function), as already known from Kernighan and Ritchie, [1988KR];
  2. the new function wmain (wide_main_function), to run with Unicode characters in the arguments;
  3. the new Windows function WinMain (Windows_main_function), without a wildargs *.* joker possibility;
  4. the new Windows function wWinMain (wide_Windows_main_function), without documentation, without wildargs *.*, but with Unicode characters in the arguments.
The first two functions start a text window, while the two last functions start a new graphics window, instead of a text window.

This means for practice:

  1. If you want to use in a text window just 256 characters of your codepage, then furtheron use main (main_function).
  2. If you want to use in a text window all 65536 characters of Unicode, then use wmain (wide_main_function).
  3. If you want to use in a graphics window just 256 characters of your codepage, then use WinMain (Windows_main_function).
  4. If you want to use in a graphics window all 65536 characters of Unicode, then use wWinMain (wide_Windows_main_function).
For each of these possibilities, the right linker settings must be mentioned correctly in the corresponding make file. This necessity can be done by own programmes, which for example start a source file with 8 bit characters by main (main_function) or WinMain (Windows_main_function), while a source file with Unicode characters leads to wmain (wide_main_function) or wWinMain (wide_Windows_main_function).

After the programme start, the start window can be closed by the programme and be replaced by a graphics or text window. Also programmes are possible, which handle a file in background only.

The First C Programme (next contribution) Table of Contents impdef.exe (privious contribution)
Deutsche Fassung Esperanta versio