beautypg.com

Dynamic link library, The dll example – HP Integrity NonStop J-Series User Manual

Page 259

background image

Click on the banner to return to the user guide home page.

©Copyright 1996 Rogue Wave Software

Dynamic Link Library

The Tools.h++ Class Library can be linked as a Microsoft Windows 3.X Dynamic Link Library
(DLL). In a DLL, linking occurs at run time when the routine is actually used. This results in
much smaller executables because routines are pulled in only as needed. Another advantage is
that many applications can share the same code, rather than duplicating it in each application.

Because Windows and C++ technology is evolving so rapidly, be sure to check the file
TOOLDLL.DOC on your distribution disk for more updates.

The DLL Example

This section discusses a sample Windows application, DEMO.CPP, that uses the Tools.h++
DLL. The code for this program can be found in the subdirectory DLLDEMO. This program
falls into the familiar category of "Hello World" examples.

Figure 9. The demo program window.

The program is somewhat unusual, however, in that it maintains a linked list of Drawable
objects you can insert into the window at run time. You can find the list, which is implemented
using class

RWSlistCollectables

, in the subdirectory DLLDEMO. The discussion in this section

assumes that you are somewhat familiar with Windows 3.X programming, but not with its
relationship to C++.

Here's the main program of DEMO.CPP, the sample Windows application that uses the

This manual is related to the following products: