Use Automation Objects
Create node objects, select processes, and select statistics using automation objects.
This topic explains how to use the node factory and nodes, select statistics, and select Processes. The Connect:Direct® automation objects use late binding, so you must dimension your variables as type Object.
Create Node Objects
The Connect:Direct node factory creates node objects. These node objects serve as virtual servers and represent a connection to a Connect:Direct server (node).
To obtain a connection (and therefore a node), you must use the node factory. Create the node factory using the ProgID CD.NodeFactory:
|
|
Node Usage
The node object represents the connection to a Connect:Direct node. Using the node enables you to select statistics or Processes.
Select Processes
|
Select Statistics
To select statistics records, you must format a select statistics command and pass it on to the SelectStats method of the node. The records return as Statistic objects stored in a StatCollection container. Because a background thread populates the collection, it returns to the caller before it is completely filled. Therefore, the only access method available is using the For Each construct.
|
Because the server can send records slowly, the interface can be jerky while reading records. Because records are read using a background thread, it useful to select the statistics before time-consuming tasks like constructing windows. This method enables the server to send records in background.
Automation Class Errors
The automation classes use the standard Visual Basic error-handling mechanism. When an error is raised in an automation object, no real value is returned from the function. For example, if an error is raised in the node factory example in the Create an Object to connect to a Node topic (see related link below), the node does not have a value (it has the default value of nothing) because CreateNode has not returned anything.
When the Connect:Direct automation objects raise an error, they set the error number to a Connect:Direct SDK error value and store a description in the error text.