FAR Calls

In looking at Windows functions, you'll frequently see the FAR keyword used in front of a function. Programs are divided into code segments and data segments. When a program is compiled, FAR instructs QuickC to use a 32-bit address for a function. This is required when a routine calls a function in another code segment.

Since the code running Windows is in a different segment than a program's code, a function must be declared FAR if Windows needs to call the function in your program.

Common functions that need to be declared FAR include dialog routines and window functions. WinMain is the main exception to this rule and should never be declared FAR.

For more information concerning FAR, see the “Creating Windows Programs” section.