Platform SDK: Active Directory, ADSI, and Directory Services |
The property methods of the IADsClass interface get or set the following properties. For a general discussion of property methods, see Interface Property Methods.
Property | Description |
---|---|
Abstract
[Visual Basic] [C++] |
Boolean value indicating whether this class is Abstract or non-abstract. When TRUE, this class is an Abstract class and cannot be directly instantiated in the directory service. Abstract classes can only be used as super classes. |
AuxDerivedFrom
[Visual Basic] [C++] |
Array of ADsPath strings that indicate the super Auxiliary classes this class derives from. |
Auxiliary
[Visual Basic] [C++] |
Boolean value that indicates whether or not this class is Auxiliary. When TRUE, this class is an Auxiliary class and cannot be directly instantiated in the directory service. Auxiliary classes can only be used as super classes of other Auxiliary classes or as a source of additional properties on structural classes. |
CLSID
[Visual Basic] [C++] |
Optional provider-specific CLSID identifying the COM object that implements this class. |
Container
[Visual Basic] [C++] |
Boolean value that indicates whether this class can be a container of other object classes. If this value is TRUE, you can call the get_Containment method to get an array of the object classes that this class can contain. |
Containment
[Visual Basic] [C++] |
A BSTR array in which each element is the name of an object class that this class can contain. |
DerivedFrom
[Visual Basic] [C++] |
Array of ADsPath strings that indicate which classes this class was derived from. |
HelpFileContext
[Visual Basic] [C++] |
Context ID inside HelpFileName where specific information for this class can be found. |
HelpFileName
[Visual Basic] [C++] |
Name of a help file that contains further information about objects of this class. |
MandatoryProperties
[Visual Basic] [C++] |
SAFEARRAY of BSTRs that lists the properties that must be set for this class to be written to storage. |
OptionalProperties
[Visual Basic] [C++] |
SAFEARRAY of BSTRs that lists the properties that are optional for this schema class. |
NamingProperties
[Visual Basic] [C++] |
SAFEARRAY of BSTRs that lists the properties that are used for naming attributes of this schema class. For example, in NDS, "CN" and "OU" are naming properties. |
OID
[Visual Basic] [C++] |
Provider-specific Object Identifier that defines this class. This is provided to allow schema extension, using Active Directory™, in directory services that require provider-specific OIDs for classes. |
PossibleSuperiors
[Visual Basic] [C++] |
Array of ADsPath strings that indicate the schema classes that can contain instances of this class. |
PrimaryInterface
[Visual Basic] [C++] |
Optional provider-specific identifier GUID that associates an interface to objects of this schema class. For example, the "User" class that supports IADsUser and PrimaryInterface is identified by IID_IADsUser. This must be in the standard string format of a GUID, as defined by COM. This GUID is the value that will appear in the IADs::get_GUID property in instances of this class for providers that implement this property. Identifying a schema class by IID of the class code's primary interface enables the use of QueryInterface at run time to determine whether an object is of the desired class. |
The following Visual Basic® code snippet shows how to use the IADsClass interface to determine if an object can be a container and, if so, lists the names of any contained objects.
Dim ads As IADs Dim cls As IADsClass Set ads = GetObject("WinNT://myComputer,computer") Set cls = GetObject(ads.Schema) if cls.Container = True Then MsgBox "This object contains the following children:" For each o in cls.Containment MsgBox o Next End If
The following C++ code snippet shows how to use the IADsClass interface to determine if an object can be a container and, if so, lists the names of any contained objects.
HRESULT hr; IADsClass *pCls; IADs *pADs; BSTR bstrSchema, bstr; VARIANT var; hr = CoInitialize(NULL); hr = ADsGetObject(L"WinNT://myComputer,computer", IID_IADs, (void**)&pADs); if (FAILED(hr)) { return hr;} hr = pADs->get_Schema(&bstrSchema); pADs->Release(); if(FAILED(hr)) { return hr; } hr = ADsGetObject(bstrSchema, IID_IADsClass, (void**)&pCls); if(FAILED(hr)) { return hr; } VariantInit(&var); VARIANT_BOOL bCont; pCls->get_Container(&bCont); if(bCont != false) { VariantClear(&var); pCls->get_Containment(&var); hr = printVarArray(var); } CoUninitialize();