XLL+ Class Library (6.3)

Asynchronous function support in projects

To support asynchronous functions, a project needs two small changes to the code. If you select "Support asynchronous functions" in the XLL+ AppWizard when you create the add-in project, these lines will be added for you.

  1. In the project header file, add the following line:

    CopyC++
    #include <rtdlink.h>

    This pulls in all the necessary run-time class definitions.

  2. Within the definition of the application class, declare a member variable named m_rtd, of type CRtdLink:

    CopyC++
    class CAvgOptApp : public CXllApp
    {
        ...
    
    // Data
        CXlOperCache m_cache;
        CString m_strCacheFile;
    
    // Asynchronous functions    
        CRtdLink m_rtd;          
    
        ...
    };

    The CRtdLink will create and manage the worker threads, handle the RTD server comunications and hold the data cache.

With these changes in place, your asynchronous functions will compile and run successfully.

Next: Upgrading asynchronous functions from XLL+ 6.0 >>