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:
- The usual function main (main_function), as already known from
Kernighan and Ritchie, [1988KR];
- the new function wmain (wide_main_function), to run with Unicode
characters in the arguments;
- the new Windows function WinMain (Windows_main_function), without a
wildargs *.* joker possibility;
- 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:
- If you want to use in a text window just 256 characters of your codepage, then
furtheron use main (main_function).
- If you want to use in a text window all 65536 characters of Unicode, then
use wmain (wide_main_function).
- If you want to use in a graphics window just 256 characters of your codepage, then
use WinMain (Windows_main_function).
- 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.