Functions in the Framework Library

The Framework library was created to help make writing XLLs easier. It includes simple functions for managing XLOPER memory, creating temporary XLOPERs, robustly calling the Excel4 function, and printing debugging strings on an attached terminal.

The functions included in this library help simplify a piece of code that looks like this: . . .

XLOPER xMissing, xBool;
xMissing.xltype = xltypeMissing;
xBool.xltype = xltypeBool;
xBool.val.bool = 0;
Excel4(xlcDisplay, 0, 2, (LPXLOPER) &xMissing, (LPXLOPER) &xBool);

To look like this:

Excel(xlcDisplay, 0, 2, TempMissing(), TempBool(0));

The following functions are included in the Framework library:

DebugPrintf

TempActiveRef

TempNum

Excel

TempActiveCell

TempStr

FreeAllTempMemory

TempActiveRow

TempBool

InitFramework

TempActiveColumn

TempInt

QuitFramework

TempMissing

TempErr


Using these functions shortens the amount of time required to write a DLL or XLL. Starting development from the sample application GENERIC also shortens development time. Use GENERIC.C as a template to help set up the framework of an XLL and then replace the existing code with your own.

The temporary XLOPER functions create XLOPER values using memory from a local heap managed by the Framework library. The XLOPER values remain valid until you call the FreeAllTempMemory function or the Excel function (the Excel function frees all temporary memory before it returns).

To use the Framework library functions, you must include the FRAMEWRK.H file in your C code and add the FRAMEWRK.C or FRMWRK32.LIB files to your code project.