LINK Help (linker.hlp) (
Table of Contents;
Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
IMPORTS Statement
◄Up► ◄Contents► ◄Index► ◄Back►
─────LINK───────────────────────────────────────────────────────────────────
Syntax: IMPORTS
importdefinitions
Defines the names and locations of functions and data items to be
imported (usually from a DLL) for use in the application or DLL.
An <importdefinition> is required for each imported function or
data item.
IMPORTS is an alternative to resolving references through an
import library created by the IMPLIB utility. Functions and data
items in an import library do not require an IMPORTS definition.
See: ◄IMPLIB Summary► (in Miscellaneous Utilities Help)
The IMPORTS keyword marks the beginning of a section of import
definitions. Multiple definitions must be separated by one or more
spaces, tabs, or newline characters. IMPORTS must appear once
before the first definition (on the same or preceding line) and
can be repeated before each additional definition. IMPORTS
statements can appear more than once in the file.
Import-Definition Syntax
[internalname=]modulename.entry
<internalname> The function or data-item name as it is used in
the importing application or DLL. The default is
<entry>. An <internalname> is required if <entry>
is an ordinal value.
<modulename> The filename of the exporting application or DLL
that contains the function or data item.
<entry> The name or ordinal value of the function or data
item as defined in the <modulename> program. A
decorated name is required if <entry> is a C++
function. Ordinal values are set in EXPORTS.
See: ◄EXPORTS Statement►
◄Decorated Names►
Internal and External Names
A given symbol (function or data item) has a name for each of
three different contexts in two programs (applications or DLLs):
■ Within the exporting program
■ As an entry point between programs
■ Within the importing program where the symbol is used
If neither program uses an internal name, the symbol has the same
name in all three contexts. If either of the programs uses an
internal name, the symbol may have more than one distinct name.
Example
IMPORTS
Sample.SampleRead
SampleA.SampleWrite
ReadChar = Read.1
This example defines three functions to be imported. The functions
are found in the Sample, SampleA, and Read applications or DLLs.
The function from Read is referred to as ReadChar in
the importing application or DLL. The original name of the
function, as it is defined in Read, may or may not be known and is
not included in the IMPORTS statement.
-♦-