Build and Test AutoClik Step 2

AutoClik is mostly implemented now. You can try it out with the Autodriv application. For more information on loading and using Autodriv, see Preview of the AutoClik Application in Lesson 1.

To test AutoClik Step 2

  1. Build and then run AutoClik.exe to register the Step 2 version as the component application that Autodriv will load.

  2. Close AutoClik.

  3. Run Autodriv (which launches the newly-registered AutoClik) and try the following things:
    • Click the Set X and Set Y buttons in Autodriv.

    • Change the x and y coordinates in Autodriv and click Set All.

    • Click around in AutoClik and click the Get All button in Autodriv.

    • Change the text in the Text box of Autodriv and click the Set Text button.

    Nothing happens—Why?

    Set X and Set Y call AutoClik’s SetX and SetY methods, which call CAutoClickDoc::Refresh. This means that when you use Autodriv’s Set X and Set Y functions, the change shows up immediately in AutoClik’s window.

    In contrast, Autodriv’s Set Text function directly accesses the m_str member variable of AutoClik’s document. The change does not show up in AutoClik’s window until you call Refresh Display from Autodriv, which calls AutoClik’s RefreshWindow method, which in turn calls CAutoClickDoc::Refresh.

    • Click the Refresh Display button.

    The changes you entered in the Text box are displayed in AutoClik’s window.

    Note that the GetPosition and SetPosition methods have not been implemented. You will implement them in Step 3.