Appendix 1: Contents of the CD ROM

 

This appendix briefly outlines the contents of the CD ROM that accompanies this book.

 

The CD contains a number of workbooks which demonstrate or contain functions that are referred to in the book.  These are not described in further detail in this appendix.

 

The CD also contains three DLL projects, each in two formats: Microsoft Visual Studio version 6.0 (described as VC6 in this appendix); Microsoft Visual Studio .NET C++ v 6.0.  Note that code provided with this edition of the book should not in any way be considered as compatible with the code supplied with the first edition of this book.

 

No warranty, explicit or implied, is made by either the author or publisher as to the quality, fitness for a particular purpose, accuracy or appropriateness of the source code on the CD ROM.  You should not rely on any part of this code without having completely satisfied yourself that it is correct and appropriate for your needs.

 

The projects are:

 

 

VC++ Project “GetTime”

 

Source files

Overview

GetTime.cpp

Code relating to getting the system time and system clock.

GetTime.def

Definition file containing the exported functions.

 

 

VC++ Project “Skeleton”

 

Source files

Overview

Background.cpp

Background.h

Structure definitions and functions for creating, managing background threads, and assignment of long tasks to these.

cpp_xloper.cpp

cpp_xloper.h

 

Class definition and code for the class that contains an xloper and xloper12, simplifies accessing of the contained structures, and that wraps access to the C API functions Excel4 and Excel12.

CustomUI.cpp

Examples relating to the addition and removal of custom menus and event traps, the display of custom dialogs and the running of regularly-repeating timed commands.

Exports.def

 

Definition file containing the exported functions and commands.

TLS.cpp

TLS.h

Thread-local storage (TLS) structure and initialisation and retrieval functions to enable the add-in to manage thread-local data.  This enables the add-in to export thread-safe functions that Excel 2007 can call multi-threadedly.

xlcall.cpp

xlcall.h

 

Microsoft SDK header and source files.  Contain the definitions of Excel’s data structures, function and command call-back enumerations, and the C API call-backs Excel4, Excel4v, Excel12 and Excel12v.

XllAddIn.h

Structure and constant definitions useful to all the code in the add-in project.  Class definitions used to register XLL functions (class FnRegData) and commands (class CmdRegData).

XllExports.cpp

Definitions of some (but not necessarily all) of the XLL's exported function interfaces.  These function interfaces in general call into core code in other modules or libraries in the project.

XllInterface.cpp

Functions that Excel's Add-in Manager looks for as part of the XLL interface to the DLL's functionality – the xlAuto functions.  Code that registers the DLL's functions and commands and cleans-up when the XLL is being closed.

XllNames.cpp

XllNames.h

 

Definition of a class for managing and accessing Excel names, both worksheet names and DLL-internal names, and an STL container for managing DLL-internal Excel names.

XllRegister.cpp

Class code and related functions used to register XLL functions (class FnRegData) and commands (class CmdRegData).

XllStrings.cpp

Functions that manipulate text strings.

xloper.cpp

xloper.h

Definitions of constant xlopers, functions that convert between xlopers and other data types, compare xlopers, clone xlopers, convert to and from Variant data types.

xloper12.cpp

xloper12.h

Definitions of constant xloper12s, functions that convert between xloper12s and other data types, compare xloper12s, clone xloper12s, convert to and from Variant data types and xlopers.

xl_array.cpp

xl_array.h

Examples relating to the use of the xl4_array (FP) and xl12array (FP12) Excel data types.

 

 

VC++ Project “Example”

 

All the source file in the project Skeleton are also part of this project.

 

Source files

Overview

BigData.cpp

Examples that demonstrate some possible uses of the BigData xloper (xltypeBigData).

Black.cpp

Black.h

A simple Black option class

CMS.cpp

Functions that relate to the pricing of constant maturity swap (CMS) derivatives.

Excel4_examples.cpp

Miscellaneous examples relating to the use of the C API accessed via the Excel4() and Excel4v() functions.

GetTime.cpp

Code relating to getting the system time and system clock.

InterfaceExample.cpp

Examples of XLL interface functions.

Lookup.cpp

Examples that extend the functionality of functions such as MATCH, COUNTIF and SUMIF to accommodate multiple match criteria.

MonteCarlo.cpp

Command code used to run a Monte Carlo simulation on a workbook that contains the appropriate named ranges.

OLE_utils.cpp

Examples relating to the use of COM from within a DLL to access Excel's functionality.

Performance.cpp

Functions used to time the performance of compiled C/C++ code.  This is used to test the relative performance compared to VBA.

SABR.cpp

SABR.h

Example implementation of the SABR stochastic volatility model. (MANAGING SMILE RISK, 2002, Hagan P, Kumar D, Lesniekski A, Woodward D).

Spline.cpp

Functions that create cubic splines and interpolate them, and a simple linear interpolation function.

Stack.h

A simple thread-safe stack FILO stack.

VB_interface.cpp

Examples relating to the use of VB as an interface to the DLL.  It contains examples of functions that demonstrate the acceptance from and return to VBA of different data types.

XllMatrix.cpp

XllMatrix.h

Definitions of simple classes for vectors and matrices of doubles, and example functions that calculates eigenvectors and eigenvalues for a real symmetric matrices.

XllStats.cpp

Functions that calculate the cumulative normal distribution and its inverse and that calculate random samples from this distribution using the Box-Muller transformation.