GetCDFString Method

The GetCDFString method builds and returns the CDF string defined by this object's properties and collections.

VBScript Syntax

IChannel.GetCDFString
 IProject,
  [ ISchedule,
   [ ILogTarget,
    [ fTopLevel ] ] ]

Parameters

IProject

An IProject dispinterface.

ISchedule

An optional ISchedule dispinterface.

ILogTarget

An optional ILogTarget dispinterface.

fTopLevel

An optional integer flag specifying whether to build a <GENERATED-BY> element.

Return Value

The CDF formatted string (VT_BSTR)

Remarks

When this method is invoked, the following occurs:

  1. All defined properties of the object cause the construction and addition of their corresponding attribute or element to the CDF string.

  2. All collections are enumerated, and the corresponding element constructed and added to the CDF string. For collections of dispinterfaces, GetCDFString is invoked on each and the returned strings are added to the CDF string.

  3. Each Channel object represents a node in the overall hierarchy of objects. When the GetCDFString method is invoked on a particular node (Channel object), the complete CDF formatted string representing that portion of the hierarchy is produced that starts with said node and descends along all possible paths to terminating leafs. (I.e., that portion of the overall hierarchy is generated recursively, starting with the Channel object on which GetCDFString was invoked.)

The IProject parameter is required for all invocations of GetCDFString. This Project object is used to map the strings in the LogoRefs collection to ILogo dispinterfaces found the associated Project object's Logos collection. For each mapped dispinterface, the GetCDFString method is invoked on each and the resulting string is added to the total CDF string.

The ISchedule, ILogTarget and fTopLevel optional arguments can be used to add the SCHEDULE, LOGTARGET and GENERATED-BY elements to the Channel object's CDF string. When passed, the GetCDFString method is invoked on each dispinterface and the resulting string added to the total CDF string. The integer flag, if set to 1, causes the insertion of a GENERATED-BY element. These dispinterfaces do not get propagated to objects in collections.

Example

VBScript and Windows Scripting Host

Set IDispProject = CreateObject("Push.Project")
Set IDispSchedule = CreateObject("Push.Schedule")
Set IDispLogTarget = CreateObject("Push.LogTarget")
Set IDispTopChan = oProject.Channel
Set IDispSubChan = oTopChan.AddSubchannel
Set IDispSubSubChan = oSubChan.AddSubchannel
wscript.echo IDispTopChan.GetCDFString IDispProject, IDispSchedule, IDispLogTarget, 1

would produce the following CDF string: (abbreviated to emphasize the hierarchy)

<CHANNEL>
<SCHEDULE></SCHEDULE>
<LOGTARGET><LOGTARGET>
<GENERATED-BY>
<CHANNEL>
   <CHANNEL></CHANNEL>
</CHANNEL>
</CHANNEL>

In this example, only the Project dispinterface is passed:

Set IDispProject = CreateObject("Push.Project")
Set IDispTopChan = oProject.Channel
wscript.echo IDispTopChannel.GetCDFString(IDispProject)

This would produce the following CDF string:

<CHANNEL></CHANNEL>


© 1997-1998 Microsoft Corporation. All rights reserved.