ShapesDynDsgn Sample

The ShapesDynDsgn designer is a design-time object that implements dynamic class information for the run-time object in addition to the features provided by the ShapesDsgn object.

Click to open or copy the ShapesDynDsgn 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).

The sample uses IProvideDynamicClassInfoImpl to dynamically change the run-time object's type information and provide access to the shapes that a user adds to the designer surface. The ShapesDynDsgn designer provides run-time access to the shapes through collections.

To build the ShapesDynDsgn sample

Using the Designer at Design Time:

The designer has a separate run-time object (ShapesDynInst.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 ShapesDynDsgn.

Open an ActiveX DLL project, then go to the Project\Components menu. Open the Designers tab and select Ax98 SDK Shapes Dynamic Designer Sample to add the designer to the project. Then select Add Ax98 SDK Shapes Dynamic 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. Note that methods to access the dynamically created subobjects are not accessible and must be exposed through public methods and properties.

Using the Designer at Run Time:

The designer has a separate run-time object. Because the designer is public (and exists in a DLL), you must explicitly create an instance of the run-time object. The prototypical run-time instance for all compiled ShapesDynDsgn designers is implemented in ShapesDynInst.dll. Use public properties and methods to provide access to the exposed subobjects of the run-time object.

See the ShapesDynInst sample for details of design-time behavior.

Sample Project

The VB_ShapesDsgn project in the VBSamples directory is a Visual Basic test program for the ShapesDynDsgn 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 ShapesDynInst 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

ShapesDynInst Sample