Share via


Visual Basic Concepts

Adding the AXDataSource Project

In order to test the MyData control, you need a test project. To allow debugging of in-process components, Visual Basic allows you to load two or more projects into a project group. In addition to enabling in-process debugging, the project group makes it easier to load your .ocx project and test project.

Note   This topic is part of a series that walks you through creating sample data source components. It begins with the topic Creating Data Sources.

To add a test project to the project group

  1. On the File menu, click Add Project to open the Add Project dialog box.

    Important   Do not click Open Project or New Project, as these will close your control project.

  2. Double-click the Standard EXE icon to add an ordinary .exe project. You can now see both projects in the Project Explorer window, and the caption of the Project Explorer window shows the default project group name.

  3. Right-click Project1 in the Project Explorer and choose Set as Start Up. The Project Explorer window identifies the Startup project by displaying its name in bold type.

  4. Select the designer for the MyData control and press CTRL+F4 to close it.

  5. Select the MyData control in the ToolBox and add it to Form1. If the code in the UserControl_Resize event executes correctly, your form should look like this:

  6. On the File menu, click Save Project Group to save the test project and the project group. Name the files as shown below. Visual Basic will provide the indicated extensions automatically.

File File name Extension
Form DataSourceTest .frm
Project DataSourceTest .vbp
Project group AXData .vbg

For More Information   Test projects for ActiveX controls are discussed in more detail in "Debugging Controls" in "Building ActiveX Controls."

Step by Step

This topic is part of a series that walks you through creating a sample ActiveX control.

To See
Go to the next step Adding Data Handling Code
Start from the beginning Creating Data Sources