RAD Studio |  |

Including the Form Unit

For your wrapper component to initialize and display the wrapped dialog box, you must add the form's unit to the uses clause of the wrapper component's unit.

Append About to the uses clause of the AboutDlg unit.

The uses clause now looks like this:

Copy Code

    uses
      Windows, SysUtils, Messages, WinTypes, WinProcs, Messages, Classes, Graphics, Controls, Forms,
      About;

Copy Code

    // for C++
    #include "About.h"
    #pragma link "About.obj"

The form unit always declares an instance of the form class. In the case of the About box, the form class is TAboutBox, and the About unit includes the following declaration:

Copy Code

    var
      AboutBox: TAboutBox;

Copy Code

    extern TAboutBox *AboutBox;

So by adding About to the uses clause, you make AboutBox available to the wrapper component.

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!