Composite controls are linked into the application using a SubStart control, through a VB Class Module. The SubStart control derives the custom properties, greetings, and nodes defined by the composite. Inside a composite, the call-flow is defined using regular VBVoice controls, but note that composite control call-flow must start with the SubBegin and end with one or more SubEnd controls. When a SubStart control loads a component, it queries the component for the list of SubEnd controls. Each SubEnd becomes an output of the host SubStart control.
EXAMPLE:
The SubStart control would look like 1) when linked to the composite in 2):
1) |
|
2) |
|
The property page of the SubStart would also be modified to include the property pages of the component. The component exposes one additional property page, Sub, and two greetings, Greet1 and Greet2, which are added to the available greetings on the Greetings property page of the SubStart control.
Property pages are designed as part of a ActiveX control project within Visual Basic. The ActiveX control in the project is not used, but is required to ensure the property page is properly registered.
After you load a component, you can modify some of its properties for a specific channel before passing the call to the composite. Use the Enter event of the SubStart control to modify desired properties. By the time the Enter event occurs in the SubStart control, the composite control will have been created and the default properties loaded. A generic function, SetChannelValue, is provided in the class interface that can be used for this purpose. The SubStart control exposes the composite object from the SubObject property.
EXAMPLE:
Set the count property to a new value, 5, for channel 1:
SubStart1.SubObject(channel).SetChannelValue("count", "5", 1)
In the class module, the SetChannelValue function can pass the new value to the destination control:
If (name = "count") Then
SubForm1.Count1.MaxCount(channel)
= newValue
EndIf
|
DLL |
EXE |
Can be pre-loaded |
DLL components are always loaded by the SubStart control when the system is started. |
If required - this is a property of SubStart control. If pre-loaded, the component will stay in memory while the host system is started. |
Loaded on demand for each call |
No. |
Yes, if not pre-loaded. An instance of the component will be created when first required by the SubStart control. If created as a multi-use ActiveX EXE (recommended), further use of the component will use the same instance. The component will normally be unloaded when the last call exits the control. |
Global event handling |
Uses LineGroup in main project. |
Global events are first routed to the SubBegin control and if not handled there, passed to the LineGroup control in the calling application. |
Multiple instances |
A DLL composite can be loaded one time only by each exe. If two instances are loaded, any modifications affect both. |
Each instance of an EXE composite is separate and can be modified separately. |
Transfer delay |
Transferring to an ActiveX DLL is very fast because they are always pre-loaded. |
There can be a noticeable delay while starting an ActiveX EXE composite because of the time required for COM to create the instance and to execute its StartSystem function (even if it is pre-loaded). |
The composite controls compiled as ActiveX EXE executables do not contain a LineGroup control. The SubBegin control acts as a proxy for the LineGroup, providing most of the functionality normally available in the LineGroup, such as: handlers for global disconnect, help digit, global tone events, line bridging, and caller-id..
The SubEnd control to specifies the exit nodes that will appear on the SubStart control when it is linked to the composite. Use as many SubEnd controls as required.