Directory Services |
The property methods of the IADsClass interface get or set the following properties. For more information, see Interface Property Methods.
Property | Description |
---|---|
Abstract
[Visual Basic] [C++] |
Boolean value that indicates if 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 if this class can be a container of other object classes. If this value is TRUE, you can call the get_Container 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 more information about objects of this class. |
MandatoryProperties
[Visual Basic] [C++] |
SAFEARRAY of VARIANTs that lists the properties that must be set for this class to be written to storage. If the class only contains one property, then get_MandatoryProperties will return a BSTR. |
NamingProperties
[Visual Basic] [C++] |
SAFEARRAY of BSTRs that lists the properties used to name 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. |
OptionalProperties
[Visual Basic] [C++] |
SAFEARRAY of VARIANTs that lists the optional properties for this schema class. If the class only contains one property, then get_OptionalProperties will return a BSTR. |
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 appears 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 code example 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 On Error GoTo Cleanup 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 Cleanup: If (Err.Number<>0) Then MsgBox("An error has occurred. " & Err.Number) End If Set ads = Nothing Set cls = Nothing
The following code example 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 = S_OK; IADsClass *pCls = NULL; IADs *pADs = NULL; BSTR bstrSchema; VARIANT var; hr = CoInitialize(NULL); hr = ADsGetObject(L"WinNT://myComputer,computer", IID_IADs, (void**)&pADs); if (FAILED(hr)) {goto Cleanup;} hr = pADs->get_Schema(&bstrSchema); pADs->Release(); if(FAILED(hr)) {goto Cleanup;} hr = ADsGetObject(bstrSchema, IID_IADsClass, (void**)&pCls); if(FAILED(hr)) {goto Cleanup;} VariantInit(&var); VARIANT_BOOL bCont; pCls->get_Container(&bCont); if(bCont != false) { VariantClear(&var); pCls->get_Containment(&var); hr = printVarArray(var); } Cleanup: if(pADs) pADs->Release(); if(pCls) pCls->Release(); SysFreeString(bstrSchema); CoUninitialize();
Client: Included in Windows XP and
Windows 2000 Professional.
Server: Included in Windows Server 2003 and
Windows 2000 Server.
Redistributable: Requires Active Directory Client Extension
on Windows NT 4.0 SP6a and Windows 95/98/Me.
Header: Declared in Iads.h.