PRB: Windows FatalExit 0x0280 Error Caused by FAR WinMain

ID Number: Q41451

1.x 2.03 2.10 3.00

WINDOWS

Summary:

SYMPTOMS

When an application is launched, a FatalExit 0x0280

(ERR_GMEMHANDLE, invalid global handle) error occurs.

CAUSE

The application declares the WinMain function as a FAR function.

The design of the Microsoft Windows kernel assumes that an

application's entry point is a near function rather than a far

function.

RESOLUTION

Remove the FAR keyword from the declaration of the WinMain

function.

Additional reference words: 1.x 2.03 2.10 3.00 2.x