The information in this article applies to:
SUMMARY
You need Link overlays to create programs that are larger than available
conventional memory. To create Link overlays, the linker adds code into
your executable (.EXE) file to manage overlays and swap portions of your
code from expanded memory, extended memory, or disk to conventional memory.
MORE INFORMATIONFor more information on Link overlays, query on the following words in this Knowledge Base: link and overlay and code and segmentUsing parentheses to create overlays is the simplest method but is not quite as versatile as using a .DEF file. To specify which modules you want to be overlaid, place parentheses around the modules on the Link command line. However, you must not overlay the main module, the one that occurs first on the Link command line. Here is an example showing how to use the parentheses method:
In this example, three overlays are created, the last of which contains two
separate modules. When you run this program, calls to a Sub procedure that
resides in one of the modules will cause that module to be copied into
conventional memory from expanded memory, extended memory, or from disk.
There are advantages in using a .DEF file. You can specify individual modules out of a library of routines without having to include them all in the overlay. Specify the .DEF file as the last parameter on the Link command line. You can create a .DEF file in the VBDOS.EXE interpreter environment or in any other text editor. A .DEF file contains the name of the source file, the class name of the code segment, and the number of the overlay. The following is a .DEF file that does the same thing as the previous Link statement shown above:
Link the program in the following manner assuming the name of the .DEF
file is MAIN.DEF:
In the .DEF file, Basic module file names are always followed by _CODE and
the class name of the code segment is always BC_CODE.
Note that there is a documentation error on Page 31 of the Professional Edition of the "Microsoft Visual Basic for MS-DOS Professional Features" manual. It states you only need the module name but omits the fact that you need to add _CODE to the end of each Basic module name. When you create overlays that use non-Basic modules, the Module name and class name can be found by viewing the .MAP file that contains the names of those routines. The following is a sample entry in a .DEF file for a non-Basic routine:
This information is documented in Chapter 2 of the Professional Edition of
the "Microsoft Visual Basic for MS-DOS Professional Features" manual.
Additional query words: VBmsdos 1.00 docerr
Keywords : |
Last Reviewed: December 8, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |