XLL+ Class Library (6.3)

PartialReg Sample

Demonstrates how to control at run-time which add-in functions are registered and which are not

Overview

This project demonstrates how to control at run-time which add-in functions are registered and which are not. This technique can be used to support different licenses or user classes.

Implementation

The significant part of the application was implemented by adding the following lines to the InitInstance() method:

CopyC++
const TCHAR* apszOptionalFns[] = { ... };

for (int i = 0; apszOptionalFns[i]; i++)
    RemoveFn(apszOptionalFns[i]);

This code removes the specified add-in functions from the list of add-in functions built in AddStaticFns(). These functions will not be registered, and will not be available from Excel.

Classes and functions used

CXllApp::RemoveFn | CWinApp::InitInstance()

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 PartialReg.sln or the project file PartialReg.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 PartialReg.help.xml and PartialReg.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