📄 manual.txt
字号:
information which may describe features/updates added after
the printing of this manual.
Header Files
There are four header files associated with the AlertDriver
Class Library:
ADWINDLL.H Prototypes of functions used in Microsoft
Windows helper DLL.
ALERTDRV.H AlertDriver class (and derivatives)
declarations.
ALERTOBJ.H AlertableObject class declaration.
ENVIRON.H Compilation- and target-specific declarations.
You will normally #include the ALERTOBJ.H and/or ALERTDRV.H
header files in your source code files to give the compiler
the necessary class declarations and/or function prototypes.
(The Class Library Reference chapter lists the appropriate
header file for each identifier which your program may need
to access from the AlertDriver Class Library.)
The ADWINDLL.H header file is automatically #included by the
AlertDriver Class Library whenever you compile your program
for the Microsoft Windows platform. You will normally not
need to be concerned with this file.
The ENVIRON.H header file is a special file which contains
all of the compilation- and target-specific declarations
needed to compile your program for different environments.
You may need to replace the first two (2) #define statements
in ENVIRON.H to compile your program for the appropriate
environment (see below). Don't worry: this is extremely
easy to do and the header file itself is clearly documented!
Changing The Compilation Environment #define in ENVIRON.H
The first #define statement in the ENVIRON.H header file
defines the compilation environment and class library to be
used. You should replace the #define with one of the valid
entries listed below. Your choice of compilation environment
will cause the compiler to make several assumptions
(detailed below) about your code. The valid compilation
environment #defines are:
BORLAND_CONTAIN Borland's Container Class Library.
OBJECT.H will be #included and the
AlertDriver Class Library classes will be
derived from Object.
BORLAND_OWL Borland's ObjectWindows Library. Because
Borland's Windows Custom Controls Library is
used to present some alerts in customized
dialog boxes, BWCC.H will be #included
(BWCC.H is supplied with the Borland C++
compiler). OBJECT.H will also be #included
and the AlertDriver Class Library classes
will be derived from Object.
BORLAND_TV Borland's Turbo Vision Class Library.
#defines several Turbo Vision Uses_*
preprocessor definitions, then #includes the
TV.H header file. The AlertDriver Class
Library classes will be derived from TObject.
When you #define this compilation
environment, you should #define your
program's Turbo Vision Uses_* preprocessor
directives before #including any of the
AlertDriver Class Library header files. See
the Turbo Vision documentation for more
details.
NOROOT The AlertDriver Class Library classes will be
compiled without a common root class.
Changing The Target Environment #define In ENVIRON.H
The second #define statement in the ENVIRON.H header file
defines the target environment for the executable file to be
produced. You should replace the #define with one of the
valid entries listed below. Your choice of target
environment will cause the compiler to make several
assumptions (detailed below) about your code. The valid
target environment #defines are:
TARGET_DOS The program will run under the Microsoft DOS
(or compatible) operating system.
TARGET_WINDOWS The program will run under the Microsoft
Windows (or compatible) operating
environment. Header file ADWINDLL.H is
#included (this indirectly #includes
WINDOWS.H). When you #define this target
environment, you should #define your
program's WINDOWS.H preprocessor directives
(if any) before #including any of the
AlertDriver Class Library header files.
Of course, not every combination of compilation environment
and target environment is valid, so make sure that the
combination you choose makes sense (if it doesn't, the
compiler will usually give you an error). For example, the
#defines shown here are illegal:
#define BORLAND_OWL //use ObjectWindows Library
#define TARGET_DOS //ILLEGAL - cannot compile OWL apps as
DOS apps
The correct settings for ENVIRON.H for this example would
be:
#define BORLAND_OWL //use ObjectWindows Library
#define TARGET_WINDOWS //OWL apps must be Windows apps
Linking Your Programs
To link your programs, you must link the appropriate library
to your application in your MAKE or PROJECT file (see your
compiler manual for details on linking). Refer to the lists
below for the appropriate library for your compilation
environment, target environment, and memory model.
IMPORTANT - Make sure you link your programs to the right
library. If you link the wrong library, your
program will not execute.
If you #defined TARGET_DOS in ENVIRON.H as your target
environment:
Link with one of the following libraries, whichever is
appropriate for the setting you #defined for the
compilation environment in ENVIRON.H and your program's
memory model:
ADBRDCCx.LIBBorland C++ Container Classes - There
are six of these files, where x = the
first letter of the memory model
(tiny, small, medium, compact, large,
or huge). For example, ADBRDCCL.LIB
is for use with large memory model
programs.
ADBRDNRx.LIBBorland C++, no root class - There
are six of these files, where x = the
first letter of the memory model
(tiny, small, medium, compact, large,
or huge). For example, ADBRDNRL.LIB
is for use with large memory model
programs.
ADBRDTVL.LIBBorland C++ Turbo Vision - large
memory model.
ADMSDNRx.LIBMicrosoft C/C++, no root class -
There are four of these files, where
x = the first letter of the memory
model (small, medium, compact, or
large). For example, ADMSDNRL.LIB is
for use with large memory model
programs.
If you #defined BORLAND_TV as the compilation
environment, link this file:
TV.LIB Borland's Turbo Vision library
(supplied with the Borland C++
compiler).
If you #defined TARGET_WINDOWS in ENVIRON.H as your target
environment:
Link with one of the following libraries, whichever is
appropriate for the setting you #defined for the
compilation environment in ENVIRON.H and your program's
memory model:
ADBRWCCx.LIBBorland C++ Container Classes - There
are four of these files, where x =
the first letter of the memory model
(small, medium, compact, or large).
For example, ADBRWCCL.LIB is for use
with large memory model programs.
ADBRWNRx.LIBBorland C++, no root class - There
are four of these files, where x =
the first letter of the memory model
(small, medium, compact, or large).
For example, ADBRDNRL.LIB is for use
with large memory model programs.
ADBRWOWx.LIBBorland C++ ObjectWindows Library -
There are four of these files, where
x = the first letter of the memory
model (small, medium, compact, or
large). For example, ADBRWOWL.LIB is
for use with large memory model
programs.
Also link this file:
ADWINDLL.LIBImport library for the file
ADWINDLL.DLL; make sure you
distribute ADWINDLL.DLL with your
finished application!
If you #defined BORLAND_OWL as the compilation
environment, link this file:
BWCC.LIB Import library for Borland's Custom
Control Library for Windows (supplied
with the Borland C++ compiler); make
sure you distribute BWCC.DLL with
your application!
Compiler-Specific Notes
When writing programs which use the AlertDriver C++ Class
Library, you may need to know how the supplied object code
was compiled. The notes below indicate the compiler settings
used to compile the AlertDriver Class Library. You may want
to consider purchasing the Source Code Edition of the
AlertDriver C++ Class Library if you want to recompile the
AlertDriver Class Library with different compiler settings.
Borland C++ v3.1
All object code libraries and DLLs were compiled assuming
that all unsigned char variables should be explicitly
defined (unsigned chars off). Stack checking was turned off.
DOS libraries were compiled with 8086/8088 instructions.
Windows libraries were compiled with 80286 instructions,
target Windows 3.0 and above, and assume the use of the
static versions of the standard, Container Class, and/or
ObjectWindows libraries.
Microsoft C/C++ v7.0
Stack checking was turned off and the libraries were
compiled with 8086 instructions.
Compiling The Sample Programs
To compile any of the sample programs, you should follow all
of the rules and suggestions previously mentioned in this
chapter. Don't forget to correctly #define the compilation-
and target-environment macros in ENVIRON.H!
The sample file INTDEMO.CPP is the main file for the sample
program using the Integer class. (The Integer class is
discussed in the Tutorial Chapter.) To compile this program,
you should compile the INTDEMO.CPP and INTEGER.CPP files,
then link them with the appropriate AlertDriver Library .LIB
file(s). These files can be compiled for any of the
supported compilation- and/or target-environments.
If you want to compile the INTDEMO.CPP sample program as a
Windows application, you should also link the ADWIN.DEF
module definition file to your executable.
Note that the source code for the Integer class (in
INTEGER.CPP), and the INTDEMO.CPP functions which manipulate
the Integer objects, are totally compilation- and target-
environment independent.
Class Hierarchy
In the listing below, derivative classes are indented
underneath their parent class. For example, class
WindowsAlertDriver is derived from class AlertDriver, which
is derived from class AlertDriverLink.
ROOTCLASS
AlertDriverLink
AlertableObject
AlertDriver
RecordingAlertDriver
StreamAlertDriver
TextFileAlertDriver
StdAlertDri
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -