After you are done with your DTC, you can distribute it to your users. Also, you might consider providing online Help with it or enabling statement completion.
If you create your DTC in Visual Basic, see the topic, "Providing User Assistance for ActiveX Components" in the online documentation for Visual Basic. In the index, search on "Help, for components."
In the Visual C++ documentation, see the topic, "ActiveX Controls: Adding Context-Sensitive Help." In the index, search on "ActiveX controls, context-sensitive help."
Your DTC can expose its type library to the HTML editor using the:
For more information about these interfaces, see Exposing an Object Model to Visual InterDev.
Typically, you can distribute a DTC just as you would any other control. However, a Visual Basic control requires its own registration file.
For more information about distributing DTCs created in Visual C++, see the section "Installing ActiveX Controls and Redistributable DLLs" in the topic, "ActiveX Controls: Distributing ActiveX Controls" in the online documentation. You can find it by searching on "distributing ActiveX controls" in the index of the MSDN online documentation library.
You need to create a registration file because Visual Basic doesn't allow you to customize the self-registration process of a DLL or OCX. Using a registration file, you can write any value you want into the registry.
Proper ActiveX registration makes your DTC appear as an HTML design-time control in an object browser. For example, when you customize the toolbox for Visual InterDev, the dialog box shows a tab for design-time controls. To make your DTC show up in the list on this tab, you need to customize the control's registry key by setting the component category subkey.
To mark a Visual Basic control as a DTC
Implemented Categories\{73CEF3DD-AE85-11CF-A406-00AA00C00940}
. You need to make sure the CLSID in the REG file matches the CLSID of the Visual Basic control.For example, you can look at the VBSample.reg file provided with the samples in this SDK. This excerpt from that file shows the entry for the Query Builder DTC.
[HKEY_CLASSES_ROOT\CLSID\{40846038-386E-11D2-A0A1-0000F81E0CE1}\Implemented Categories\{73CEF3DD-AE85-11CF-A406-00AA00C00940}]
The registration file has four CLSIDs, one for each DTC in the VBSample.OCX. For each CLSID in the file, the component category is set to Implemented Categories\{73CEF3DD-AE85-11CF-A406-00AA00C00940}
.
Warning If you create your registration file and then rebuild the control, you need to verify that the CLSID generated by Visual Basic for self-registering matches the CLSID in the registration file you have created. Visual Basic changes the CLSID each time the project is recompiled and your registration file may no longer match the control.
To verify the CLSIDs for your control
Each user control you added to your ActiveX control project is displayed within that folder. For example, if you registered the VB sample OCX, you can find the following entries in the folder.
If the CLSIDs in registration files match the CLSIDs in the registry, DTCs show up in the Design-time Control tab in Visual InterDev.
For more information about deploying your control, see the section "Deploying ActiveX Components." Search on "ActiveX components, distributing" in the index of the MSDN online documentation.