You can use a variety of development tools to create and test a DTC. This SDK provides generic procedures for using choices as well as specific code samples for Visual Basic and Visual C++. If you are using Visual Basic or Visual C++, you might find the walkthroughs helpful. They describe specific commands and code to create and test a DTC. For testing, these samples assume you are targeting Visual InterDev and its editor as your target environment.
This SDK includes type libraries and documentation you need to write your own design-time controls. As for development tools, you can use any tool that can create ActiveX controls, including:
Creating a DTC includes the following general steps, including those for publishing and subscribing to choices. The code A Choices Walkthrough in Visual Basic and Visual C++ have samples for completing each of these steps.
To create a DTC that uses choices
Note When creating a DTC, use property pages instead of inline user interface for setting a DTC's properties. An inline user interface is the graphical representation of the DTC within the hosting document such as a form or other object with controls that accept user input. Although Visual InterDev 6.0 supports inline user interface, this is not a guarantee that all DTC hosts are required to support it now or in the future.
Filename | Reference Display name | Object Browser name |
dtc60.tlb | Microsoft DTC 60 Type Library | DTC60 |
webdc.tlb | Microsoft Web Design-time Control Type Library | MSWDCTL |
*dbsrvice.tlb | VID 6.0 Data Services Support Type Library 1.0 | DBServiceLib |
* Add a reference to this library if your DTC requires the Query Builder, URL picker, or Color picker.
Note When defining a new Choice type, be sure to specify each of the Choice object's properties. If you want to provide additional information about the choice, include Tags as well.
Tip Prefixing the type with the ProgID of the publishing DTC can help you prevent unwanted interaction with choices from other DTCs. This convention is especially helpful if you are working with multiple DTC developers.
Note Use the conversion rules as appropriate when comparing the type of a Choice object to a ChoiceFilter object.
Note The method you implement to do this depends on the language you are using. For Visual Basic projects, use the GetRunTimeText method of the IProvideRuntimeText interface. For Visual C++ and other types of projects, use the SaveRuntimeState method of the IActiveDesigner interface.
The output is handled differently in Visual Basic because it doesn't process text streams the same way as other languages.
After creating your DTC, you can build, register, and test it. The way you build and register depends on the language you are using. See Testing a DTC's Output.