XLL+ Class Library (6.3)

KeyedHandle Sample

Shows how to use an object cache with meaningful string keys

Status

The code in this add-in demonstrates the old hand-written mechanism for creating and maintaining object handles. All this functionality can be achieved without coding, using one of the handles extensions as described in the User Guide topic Using object handles.

For an up-to-date handle sample, see the NumericHandleDemo sample, which was written using the NumericHandles.xpe extension.

Remarks

This project demonstrates the use of object handles represented by meaningful string keys.

Classes and functions used

CXllApp::SetSinkEvents | CXllApp::SetComEventHandler | CXlFormulaRefresh::RefreshAllWorkbooks | CXlFormulaRefresh::RefreshWorkbook | CXlHandleStore<T, S> | CXlHandleStore<T, S>::ObjectFromHandle | CXlHandleStore<T, S>::AddObjectHandle | CXlHandleStore<T, S>::Clear | ::XllGetTypedApp

Sample project

Each sample project is located in a sub-directory of the Samples directory of the XLL+ installation. To use the sample project, open the solution file KeyedHandle.sln or the project file KeyedHandle.vcproj.

You can enable debugging under Excel by using the Setup Debugging command in the XLL+ ToolWindow.

When delivered, the help files are excluded from the build. You can enable the help build by selecting the files KeyedHandle.help.xml and KeyedHandle.chm in the Solution Explorer, and using the right-click menu to view Properties. Select the page "Configuration Properties/General" and set the "Excluded from build" property to "No". See Generating help in the User Guide for more information.

See Also

List of Sample Projects