GetNumResults Method in Class SMS_Collection
The GetNumResults WMI class method returns a count of all members in a collection — the result does not include members of subcollections.
The following syntax is simplified from MOF code and is intended to show you the definition of the method.
sint32 GetNumResults(
[in] SMS_Collection ref Collection,
[out] uint32 Result
);
Parameters
Collection
Data type: string
Qualifiers: InThe CollectionID value or object path of the collection.
Result
Data type: uint32
Qualifiers: OutNumber of collection members.
Return Values
The GetNumResults method returns a sint32 which always has the value of zero (0).
Example Code
The following example shows you how to call the GetNumResults method to get the number of collection members. Specify either a CollectionID or the full path, such as "SMS_Collection.CollectionID=""SMS00003""".
Dim clsCollection As SWbemObject 'SMS_Collection class definition Dim Results As Long 'Number of collection members Set clsCollection = Services.Get("SMS_Collection") clsCollection.GetNumResults "<collectionid>", Results
See Also
SMS_Collection, GetTotalNumResults Method in Class SMS_Collection