Click or drag to resize

IMcObjectsGetCategoryItem Method

Implements the standard collection "Item" method for one category and some particular (or no) parent object.

Namespace:  MediaCy.IQL.ObjectManager
Assembly:  MediaCy.IQL.ObjectManager (in MediaCy.IQL.ObjectManager.dll) Version: 10.0.6912.0
Syntax
VB
Function GetCategoryItem ( 
	varCategoryNameOrID As Object,
	bstrName As String,
	<OptionalAttribute> varParentIMcObject As Object,
	Optional bstrNamespace As String = "",
	Optional eLookupMethods As mcobjNamespaceMatchMethods = mcobjNamespaceMatchMethods.mcobjMatchMethodDefault
) As McObject

Parameters

varCategoryNameOrID
Type: SystemObject
[in] Category name or ID (as returned from RegisterCategory). This may be VT_EMTPY or zero, to indicate objects not part of any category.
bstrName
Type: SystemString
[in] Name of the McObject sought. The name may have "dot" syntax if the item is a child of some other object and it may use the "double colon" syntax for namespaces. Any "double colon" syntax will override the effect of the bstrNamespace and eLookupMethods arguments (below). If a namespace is specified by the "double colon" syntax then it must match exactly. If a parent is specified without a "Namespace::", then it is looked up using the same namespace rules as for the target name (see below).
varParentIMcObject (Optional)
Type: SystemObject
VARIANT [in, optional] The parent object, or if missing (VT_EMTPY, VT_ERROR or VT_NULL) or a NULL pointer, then only an object with no parent is found.
bstrNamespace (Optional)
Type: SystemString
[in, optional] Namespace to use for the lookup of the object name supplied by bstrName, or NULL or empty to use the default Namespace (see the Namespace property). The eLookupMethods argument controls how the bstrNamespace is used in the lookup. Supply a value of "::" (double colon) to specify the global namespace, irrespective of the current default Namespace property. If the name is given using "double colon" syntax for namespaces, that overrides the effect of this argument and the eLookupMethods argument.
eLookupMethods (Optional)
Type: MediaCy.IQL.ObjectManagermcobjNamespaceMatchMethods
mcobjNamespaceMatchMethods [in, defaultvalue(mcobjMatchMethodDefault)] The default behavior (0) differs depending on whether bstrNamespace is given or not. If no bstrNamespace argument is supplied, then the mcobjMatchScopedNamespace method is used with the default Namespace property as the target namespace. If a particular bstrNamespace is supplied, then the default lookup method is mcobjMatchExactNamespace.

Return Value

Type: McObject
The McObject (S_OK is returned from the method call) or Nothing if the specified item was not found (S_FALSE returned from the method). Use "Is Nothing" from VB to test the returned object.
Remarks
Items must be specified by name and their parent object, if any. A Namespace to use for the name lookup can be specified and several methods can be specified for its use. If a requested name with the specified parent is not found in the category, then a search is made for an "Auto Add" with the requested name and namespace, which was previously attached to the requested category by AttachAutoAddToCategory. If a name match is found and the parent object is compatible with the type specified in the AttachAutoAddToCategory call, then an McObject instance is automatically created.
See Also