Composite objects Composite definitions
The composite object definition files contain UDS (Universal Data Structures or also called in the older parts of the documentation SDA - Standard Data Structures). The formats recognized by the VaryDispCreator object are text, binary and under some circumstances registry. See ConfigFile for more info about the UDS in general.

The description below is explained using the text format but the best format is of course binary. In text format multi-line texts cannot be preserved so it cannot contain the entire script (if script is used as part of the composite object). However text format is best for the development phase and can be easily converted to binary format and (if desired) where script files scattered through the local file system are specified in the definition - they can be replaced with their content in the binary file. This process is like a compilation process but it is much simpler so you can use this script to do the conversion. So the definition description below only describes the structure of the definition - the actual format used may differ.

Composite definition

CLASS section

This section is optional. It  is required only if the definition will be registered with the system (using the VaryDispCreator's RegisterClass/UnRegisterClass methods).

  { CLASS:
    ; Program ID for the component. Usually one of the following two
    ; name compositions are used:
    ;   CompanyName.ComponentName
    ;   or
    ;   CompanyName.Category.ComponentName
    (string)ProgID=<Prog ID of the class - version independent>
    ; Usually the ProgID from the previous entry ending with ".N"
    ; Where N is the version number
    (string)VerProgID=<Versioned prog ID>
    ; A class ID generated for the object. Use GUIDGEN utility or
    ; write a simple script that uses SFMain.NewGUID
    (string)ClassID=<{-class-ID-}>
    ; Human readable name
    (string)ClassName=<Readable name>
    ; Threading model for the object. If scripts are used Apartment 
    ; is strongly recommended. Also the keywords Free and Both can be used
    (string)Threading=<Threading model>
  } CLASS;

OPTIONS section

The section is optional. It contains miscellaneous options which can be specified or not. They have internally defined default values.

  { OPTIONS:
         ; The context object name (for the scripts)/method name 
         ; for the method that will be called to advise the objects 
	(string)ContextName=<Context item and the context member>
         ; Default scripting language for the scripting parts
         ; Used if Language option is omitted in them
	(string)DefaultScriptLanguage=<Default script language for script nodes>
  } OPTIONS;

COMPONENTS section

Contains the list of the objects and/or scripts in the composite object. Each object is described with a sub-section that may contain in turn list of the exported members.

  ; Required section
  { COMPONENTS:

Typical COM object section

    ; The name of the section is the name of the object.
    ; This name can be used to access the object from the composite manager
    ; VaryDisp object or by the other objects in the composite through
    ; the VaryDispCtx object 
    { Name1:
        ; Type option must be set to COM for the COM objects
        (string)Type=COM
        ; ClassID or ProgID of the COM object
        (string)Class=<ClassID or ProgID>
        ; 1 if the VaryDispCtx should be passed to the object
        ; 0 if the object does not need access to the other objects in the
        ; composite  
        (int)Connect=<1 - advise, 0 - unaware of others>

Expose members from the object (if any)
This subsection contains one section for each exposed member of the object. If no members are exposed (for example the object is used only by the other objects in the
composite) the MEMBERS section can be omitted.

        { MEMBERS:
            ; The section name is the name under which the member will be visible for
            ; the world
            { AssignedMemberName:
                ; If specified this DISPID will be assigned to the exposed member
                (int)DISPID=<dispid if not automatic>
                ; The name of the member in the class
                (string)InternalName=<Name in the class>
                ; Role/Type of the member - which dispatch call types are allowed
                (int)Type=<flags combination - 0 - defaults to 7>
            } AssignedMemberName;
            ; More sections like the above if other members are exposed too
        } MEMBERS;
    } Name1;

Script object section
Specifies a script component of the composite. The script is in one language (for example VBScript or JScript). It is started when the composite is created and has a chance to initialize itself.

    ; The name of the section is the name of the object (as above). The actual 
    ; object accessed when this name is referred is the ScriptManager2 object used
    ; to hold the script.
    { Name2:
        ; Type is set to SCRIPT for script components
        (string)Type=SCRIPT
        ; Scripting language name
        (string)Language=<script language if not default>
        ; If present the name of the file where the script is
        (string)File=<File to load>
        ; If present contains the script text (see remarks)
        (string)Script=<Code inline>
        ; Members are exposed the same way as for the typical COM objects (see above)
        ; Any function/sub or variable declared on global scope can be exposed.
    } Name2;
  } COMPONENTS;

Remarks

The text format is not appropriate for inline scripts (see Script entry above). However it is the best method for binary format. So the suggested way is to develop the component using text format and after completing it convert it to binary UDS format and replace all the File entries in the script components with Script entries - e.g. import the files into the binary UDS file.

newObjects Copyright 2001-2006 newObjects [ ]