XLL+ Class Library

PartialReg Sample

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:

const char* 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.

Functions used

CXllApp::RemoveFn
CWinApp::InitInstance()

Project files

If you are using MS Developer Studio 6, then you should open the project file PartialReg.dsp.

If you are using MS Visual Studio .NET 2002, then you should open the solution file PartialReg.sln or the project file PartialReg.vcproj.

If you are using MS Visual Studio .NET 2003, then you should open the solution file PartialReg71.sln or the project file PartialReg71.vcproj.

If you are using MS Visual Studio 2005, then you should open the solution file PartialReg8.sln or the project file PartialReg8.vcproj.

See Also

List of Sample Projects | Samples and Walkthroughs