ShapesDsgn Sample

The ShapesDsgn designer is a design-time object that implements its run-time object in the ShapesInst sample.

Click to open or copy the ShapesDsgn project files.

Click to open or copy the files for the Bin directory (required).

Click to open or copy the files for the Include directory (required).

This sample demonstrates the following features:

To build the ShapesDsgn sample

Using the Designer at Design Time:

The designer has a separate run-time object (ShapesInst.dll), which must be registered before you can use the designer. The supplied build procedures will register the designers for you, so ensure that you've built ShapesInst before running ShapesDsgn.

Open an ActiveX DLL project, then go to the Project\Components menu. Open the Designers tab and select Ax98 SDK Shapes Designer Sample to add the designer to the project. Then select Add Ax98 SDK Shapes Designer Sample on the Project menu to create an instance of the designer.

To add shapes, drag and drop or click and drag objects onto the designer surface.

Before building the DLL, set the designer's Public property to TRUE. (Visual Basic displays a dialog box containing a long information message when you change this value.) In addition, to access the subobjects you create at run time, you must provide access to the base object collections for the three shapes through the public properties. If you do not, Visual Basic will generate run-time warnings.

Using the Designer at Run Time:

Because the designer is public (and exists in a DLL), you must explicitly create an instance at run time.

If you provide access to the collection subobjects of the designer, you can iterate through the collections to view the properties of all subobjects you create at run time. The VB_ShapesDsgn project in the VBSamples directory shows you how.

Sample Project

The VB_ShapesDsgn project in the VBSamples directory is a Visual Basic test program for the ShapesDsgn sample. To use this project in Visual Basic, create an ActiveX DLL project. On the File menu, click Open Project, then navigate to the VB_Samples\VB_ShapesDsgn directory. Select ShapesDsgn.vbp to load the project files into the Visual Basic environment.

Sample Start-Up Program

The VB_ShapesClient project in the VBSamples directory is a Visual Basic project you can use as a start-up application for the ShapesDsgn designer. To use the client, you must first register the Regobj.dll from the samples\bin directory. Then, when ShapesDsgn prompts for a start-up application, specify ShapesClient.exe.

See Also

ShapesInst Sample