The STUB Statement

The STUB statement adds a DOS executable file to the beginning of a Windows application or DLL. The stub is invoked whenever the file is executed under DOS. Usually, the stub displays a message and terminates execution. By default, the linker adds a standard stub for this purpose.

Summary: Syntax

STUB {'filename' | NONE}

Summary: Remarks

The filename specifies the DOS executable file to be added. The linker searches for filename first in the current directory and then in directories specified with the PATH environment variable. The filename must be surrounded by single or double quotation marks (' or ").

The alternate specification NONE prevents the linker from adding a default stub. This saves space in the application or DLL, but the resulting file will hang the system if loaded in DOS.

Summary: Example

The following example inserts the DOS executable file STOPIT.EXE at the beginning of the application or DLL:

STUB 'STOPIT.EXE'

The file STOPIT.EXE is executed when you attempt to run the application or DLL under DOS.