Article ID: 107546
Article Last Modified on 8/9/2004
119591 How to Obtain Microsoft Support Files from Online Services
Description: Adds the indicated item to the collection. If an object
is created, it should be returned.
Arguments: Varies. It can be a pointer to the object that is to be
added or it can the information required to create the
object.
Return type: Varies. If no object is created, the return type should
be void. If an object is created, the return type should
be VT_DISPATCH.
NOTE: The Add method is not appropriate for all collections, so it is
not required. For many application-created collections, objects are
automatically added to the collection for the user.
Description: Returns the number of items in the collection. Read-only
property.
Arguments: None.
Return type: VT_I4.
Description: Returns the indicated item in the collection.
Argument: Specifies the index. Some collections allow various types
of indexing. For example, this sample allows an integer or
string to be specified as an index.
Return type: VT_DISPATCH.
NOTE: Item is the default value for the object, so it should have the
special DISPID, DISPID_VALUE. MkTypLib automatically assigns this DISPID if the
default attribute is specified in the ODL file.
Description: Returns an enumerator that supports IEnumVariant for the
items currently in the collection. Read-only property.
Arguments: None.
Return type: VT_UNKNOWN.
NOTE: NewEnum will not be accessible to users and must have the
restricted attribute in the ODL file. The NewEnum method must have a special
DISPID, DISPID_NEWENUM. The defining characteristic of a collection is the
ability for a user to iterate over the items in it. Some languages will have
built- in support for collections. The NewEnum method allows an OLE automation
controller to support "for each" iteration over a collection: For Each Item In Collection Debug.Print Item.Text Next ItemOLE automation controllers that support "for each" iteration will call the NewEnum method on the collection object and then QueryInterface on the resulting IUnknown to get the desired IEnumVariant.
Description: Removes the specified item from the collection.
Argument: Specifies the index. Some collections allow various types
of indexing. For example, this sample allows an integer
or string to be specified as an index.
Return type: void.
NOTE: The object is not deleted. It is simply removed from the
collection. Remove should support the same kinds of indexing as the Item()
method for the same collection. The Remove method is not appropriate for all
collections, so it is not required. For many application-created collections,
objects are automatically removed the collection for the user. ProgID : Collection.Application
Method and Property Names Notes ----------------------------------------------------------- [App Object] Collection (read only prop) Returns empty collection. New Item (method) Creates and returns new item. [Item Object] Text (default prop) Sets and returns string. [Collection Object] See above for exposed properties and methods.Update the path in HELLO.REG to the current location of the object and the type libraries.
Additional query words: AutoCtrl Collect
Keywords: kbinfo kbdownload kbdocfix kbfile kbautomation kbsample KB107546