XLL+ Class Library (6.3)

CXllApp::InitInstance

Called by the framework when the XLL is loaded into memory

virtual BOOL InitInstance( );

Return Value

TRUE if the function completes successfully; FALSE otherwise.

Remarks

This method is called whenever the XLL is loaded into memory. Note that this can occur not only when the XLL is loaded, but also whenever the XLL is examined in Excel's Tools/AddIns dialog.

Cheap initialization tasks should be done here. In particular, the following must be done:

  1. You must call CXllApp::AddStaticFns() during InitInstance(). This method locates all the add-in functions in the XLL and adds them to the list of add-in functions that will be registered with Excel.
  2. Call the base class method, CXllApp::InitInstance() and return FALSE if the method returns FALSE.

The code generated by the XLL+ AppWizard includes code for all these tasks.

MFC considerations

In the MFC builds, CXllApp is descended from CWinApp. Calling the base class InitInstance ensures that the MFC implementation is properly initialized.

Requirements

Header: xllplus.h

See Also

CXllApp Class | CXllApp Methods | CXllApp::ExitInstance | CXllApp::OnXllOpenEx()