DLL Programmer's Guide for TNS/E Systems
Example Code
DLL Programmer’s Guide for TNS/E Systems—527252-006
6-4
Example One
Here’s the creation of the object file called mystro.
run $data01.toolsy02.ccomp /in mystrngc /mystro;suppress
TNS/E C - T0549H01 - 30AUG2004 (Oct 25 2004 14:47:23)
(C)2004 Hewlett Packard Development Company, L.P.
0 remarks were issued during compilation.
0 warnings were issued during compilation.
0 errors were detected during compilation.
Object file: mystro
Compiler statistics
phase CPU seconds elapsed time file name
CCOMP \SPEEDY.$DATA01.TOOLSY02.CCOMP
CCOMBE 0.2 00:00:06 \SPEEDY.$DATA01.TOOLSY02.CCOMBE
total 0.2 00:00:06
All processes executed in CPU 04 (NSR-Y)
Swap volume: \SPEEDY.$DATA01
Build the DLL and the Program
First we build the DLL, then the main executable file called revstr. It has to be in that
order because the main executable could not refer to a DLL that did not yet exist. (If
the linker’s -allow_missing_libs option is specified, the main executable could be
linked befoe the DLL is linked.)
Note that the -lib option references the DLL called mystrdll. In Example Two we
show the main built without reference to a DLL. We will use rld to load the DLL
dynamically.
Note the -export_all option. We could also individually reference the items to be
exported, as follows:
-export StrRev
Note the -shared option sent to eld. This creates the DLL. The -dll option can be
used to do the same task, and is probably more descriptive of what we want to
achieve. Either option can be used.










