Data Transformation Services (DTS) custom tasks require entries in their class registration to identify them as DTS tasks. You can add these entries by registering the task from DTS Designer, or you can add code or script to the custom task so that it can create these entries.
In Microsoft® ActiveX® components built with Microsoft Visual Basic®, the registration code is supplied by the build process and is inaccessible to the developer. Therefore, a custom task built with Visual Basic cannot be detected by DTS until it has been registered from within DTS Designer. To create the additional registry entries, you can add code or script to custom tasks built using the Active Template Library (ATL) COM wizards in Microsoft Visual C++®.
In Visual Basic, an ActiveX DLL component containing a public class Component.CTaskClass creates a set of registry keys under \HKEY_CLASSES_ROOT\CLSID\ with this structure:
A component with class Component.CTaskClass generated by ATL COM AppWizard in Visual C++ creates a similar set of registry keys under \HKEY_CLASSES_ROOT\CLSID\:
DTS defines a component category for DTS tasks, which is a GUID that is added to the system registry when the Microsoft SQL Server™ client tools are installed on your system. To make a custom task registration visible to DTS Designer, you must add the Implemented Categories key, if it is not already there. Then, add a subkey to Implemented Categories that contains this component category. Optionally, you can add values to the {Class ID for Component.CTaskClass} key that specify the task icon and default description. The added key and values look like:
The added keys, values and data have the following descriptions.
| Element | Description |
|---|---|
| path\iconfile.ext | File specification of the component that contains icons for the custom task. Typically, this is the component that contains the task, but it can be any file from which icons can be extracted. |
| index | Position of the icon in the list of icons for the custom task. The first icon has index = 0. |
| description | Installed description of the custom task. DTS Designer appends ": undefined" to description to generate the default description when the task icon is dragged to the design sheet. |
| GUID for DTS Tasks component category | GUID that identifies the component as a DTS custom task. The value is defined by the symbol CATID_DTSCustomTask in include file dtspkg.h. |
If you are using the ATL COM wizards to implement a custom task, the simplest way to add these extra keys and values is through the registry script (.rgs) file that ATL Object Wizard generates.
After you add the script lines for the DTS task, rebuild the project and refresh the DTS cache, if necessary. The custom task appears in DTS Designer without being registered from within DTS Designer.
If you unregister the custom task from within DTS Designer, the unregistration function in DTS Designer will remove the DTS task component category subkey from the registration. To restore the subkey, you need to rebuild the project or reregister the task from the command prompt:
regsvr32 component.dll