Programming Considerations > Programming In C++ > Insert the 2D Chart Control into an OLE Container Project |
In the Visual C++ environment, a 2D Chart control behaves like any other OLE control, which means that it can be incorporated into a container such as a dialog or an application window.
To add the 2D Chart control to an OLE container project, use Component Gallery as follows:
1. From the Insert menu, select Component. The ComponentGallery dialog box appears.
2. Select the OLEControls tab.
3. Select the 2D Chart control icon in the ComponentGallery window.
4. Click the Insert button. This displays a ConfirmClasses dialog box, which lists the 2D Chart control classes.
5. Click the OK button to accept the class generated by Component Gallery.
6. Click the Close button to close Component Gallery.
At this point, the 2D Chart wrapper class, CChart2D, is added to your project. This means that the 2D chart control can now be added to your application's main dialog box, as shown below.