XLL+ Class Library (7.0)

CXllApp Class

Represents an add-in library.

class CXllApp


The CXllApp class represents your XLL add-in. It is a singleton class: only one instance may exist in any application.

Your implementation class, which is generated by the XLL Plus AppWizard, is descended from CXllApp, and contains methods and data that are unique to your specific add-in.

The CXllApp class implements most of the functionality necessary for a DLL to be accepted by Excel as an add-in library.

One and only one instance of CXllApp exists in any XLL. You can retrieve a pointer to it using the CXllApp::Instance method.

You can use your derived application class as a place to store data that must have a lifetime as long as that of the library (i.e. 'global' data). Database connections, logon details and performance statistics all fall into this category, and can usefully be stored in the application object. However, if any of your functions are marked as thread-safe you should also ensure that any data members used by thread-safe functions are also thread-safe themselves.

Data that lives in the application class exists once for each instance of the library. Thus, if you have three instances of Excel using the add-in, you will have three separate copies of the data contained in the application class.

MFC Considerations

The CXllApp class is descended from CWinApp. Your implementation class, which is generated by the XLL Plus AppWizard, is in turn descended from CXllApp.

See XLL_FIX_STATE for constraints on using the CXllAppp instance.

Common Language Runtime

Some methods that are used by the Common Language Runtime (.NET) builds are only available in those builds. These are:


In addition, the following methods have no effect except undr CLR builds:



Header: xllplus.h

See Also

CXllApp Methods | xllplus.h | CXllFn object