home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
cset21v1.zip
/
IBMCPP
/
SAMPLES
/
COMPILER
/
SAMPLE05
/
READ.ME
< prev
next >
Wrap
Text File
|
1993-05-07
|
2KB
|
43 lines
The sample program SAMPLE05 shows how to create a simple subsystem DLL and a
program to access it.
The DLL keeps a global count of the number of processes that access it,
running totals for each process that accesses the subsystem, and a grand
total for all processes. There are two external entry points for programs
accessing the subsystem. The first is DLLINCREMENT, which increments both
the grand total and the total for the calling process by the amount passed
in. The second entry point is DLLSTATS, which prints out statistics kept by
the subsystem, including the grand total and the total for the current
process.
The grand total and the total for the process are stored in a single shared
data segment of the subsystem. Each process total is stored in its own data
segment.
The files for the sample program are:
SAMPLE05.C The source for the functions in the DLL
SAMPLE05.H The user include file
SAMPLE05.DEF The module definition file for the DLL
MAIN05.C The source for the main program that accesses the subsystem
MAIN05.DEF The module definition file for MAIN05.C
To build the sample program, use the supplied make files:
MAKE05S Builds MAIN05.EXE and SAMPLE05.DLL. The compiler libraries
are linked statically.
MAKE05D Builds MAIN05.EXE and SAMPLE05.DLL. The compiler libraries
are linked dynamically.
For example:
nmake all -f make05d
To clean up after the sample program has been built and run, type the following
command:
nmake clean -f make05d