Figure 3: Abstract class with methods users must override to test their COM objects. The framework calls these methods repeatedly during the test.

class HSTSTDriver {
public:
    // Called before creating the threads
    virtual HRESULT OnBeforeStartThreads() {return S_OK;};

    // Called after the threads have been created
    virtual HRESULT OnAfterStartThreads()  {return S_OK;};

    // Called before the driver exits
    virtual HRESULT OnAfterThreadsExited() {return S_OK;};
    
    // Called at every loop
    virtual HRESULT 
    FreeThreadTest(int iIterationCounter, DWORD nThreadId, 
        CRandomGenerator*) {return S_OK;};
    virtual HRESULT 
    AptThreadTest(int iIterationCounter, DWORD nThreadId, 
        CRandomGenerator*) {return S_OK;};

    long m_numOfFreeThreads, m_numOfAptThreads;
    long m_numOfIterations;
};