Excel
Add-in Development in C/C++: Applications in Finance

The book is supplied with a CD ROM containing example
projects and many thousands of lines of source code.Despite all efforts, a couple of bugs escaped detection and made
it onto the CD ROM.All those known by
the author are posted here.If you own
the book and are aware of other defects in the text or software, please contact
the author at ExcelAddinDevelopment@eigensys.com.

Failure to make a
deep copy of an xloper for assignment to an xltypeMulti array, should not prevent the DLL freeing
the array memory.Uncorrected, this
code leaks memory whenever the function clone_xloper()
fails in this cpp_xloper
member function.

Module

XllInterface.cpp

Line

50

Line

#define USE_CPP_XLOPER 1

Comment

If the above
definition is changed to 0, a number of errors in the module appear when
compiling:

Lines 182 to 240:

MAX_NUM_FNREG_ARGS
should be replaced by

MAX_EXCEL4_ARGS – 1

Lines 216 to 236:

FuncExports
should be replaced by FunctionExports

Line 604:

return
1;

should be inserted
before the closing brace.

Module

xlcall.h

Comment

The example project
assumes that the lines

#ifndef _XLCALL_H

#define _XLCALL_H

// header file contents

#endif // _XLCALL_H

exist in this
header file.The compiler will
complain that the data structures within this header are being redefined
where the header is loaded more than once.The simplest fix is to add the following directive to the top of the
file:

#pragma once

Some downloaded versions of this file will have the
Booloean data field of the xloper defined as WORD
bool; which should be changed to WORD _bool; to
avoid it being interpreted as the C++ data type.

Module

cpp_xloper.cpp

Line

158

Old line

if(rwFirst < rwLast || colFirst < colLast)

New line

if(rwFirst > rwLast || colFirst > colLast)

Comment

The above bug
prevents the creation of xltpyeRef xlopers.

Module

xloper.cpp

Line

425 and 441

Old line

if(!p_op || rwFirst < rwLast || colFirst <
colLast)

New line

if(!p_op || rwFirst > rwLast || colFirst >
colLast)

Comment

The above bug
prevents the creation of xltpyeRef
and xltpyeSRef xlopers.