Platform SDK: Active Directory, ADSI, and Directory Services

IADsClass Property Methods

The property methods of the IADsClass interface get or set the following properties. For a general discussion of property methods, see Interface Property Methods.

Properties in Vtable Order

Property Description
Abstract

[Visual Basic]
Access: Read/Write
Data Type: BOOLEAN

[C++]
HRESULT get_Abstract
(
[out] BOOLEAN *pbAbstract);


HRESULT put_Abstract
(
[in] BOOLEAN bAbstract);

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]
Access: Read/Write
Data Type: VARIANT

[C++]
HRESULT get_AuxDerivedFrom
(
[out] VARIANT *pvAuxDerivedFrom);


HRESULT put_AuxDerivedFrom
(
[in] VARIANT vAuxDerivedFrom);

Array of ADsPath strings that indicate the super Auxiliary classes this class derives from.
Auxiliary

[Visual Basic]
Access: Read/Write
Data Type: BOOLEAN

[C++]
HRESULT get_Auxiliary
(
[out] BOOLEAN *pbAuxiliary);


HRESULT put_Auxiliary
(
[in] BOOLEAN bAuxiliary);

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]
Access: Read/Write
Data Type: BSTR

[C++]
HRESULT get_CLSID
(
[out] BSTR *pbstrCLSID);


HRESULT put_CLSID
(
[in] BSTR bstrCLSID);

Optional provider-specific CLSID identifying the COM object that implements this class.
Container

[Visual Basic]
Access: Read/Write
Data Type: BOOLEAN

[C++]
HRESULT get_Container
(
[out] BOOLEAN *pbContainer);


HRESULT put_Container
(
[in] BOOLEAN bContainer);

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]
Access: Read/Write
Data Type: VARIANT

[C++]
HRESULT get_Containment
(
[out] VARIANT *pvContainment);


HRESULT put_Containment
(
[in] VARIANT vContainment);

A BSTR array in which each element is the name of an object class that this class can contain.
DerivedFrom

[Visual Basic]
Access: Read/Write
Data Type: VARIANT

[C++]
HRESULT get_DerivedFrom
(
[out] VARIANT *pvDerivedFrom);


HRESULT put_DerivedFrom
(
[in] VARIANT vDerivedFrom);

Array of ADsPath strings that indicate which classes this class was derived from.
HelpFileContext

[Visual Basic]
Access: Read/Write
Data Type: BSTR

[C++]
HRESULT get_HelpFileContext
(
[out] BSTR *pbstrHelpFileContext);


HRESULT put_HelpFileContext
(
[in] BSTR bstrHelpFileContext);

Context ID inside HelpFileName where specific information for this class can be found.
HelpFileName

[Visual Basic]
Access: Read/Write
Data Type: BSTR

[C++]
HRESULT get_HelpFileName
(
[out] BSTR *pbstrHelpFileName);


HRESULT put_HelpFileName
(
[in] BSTR bstrHelpFileName);

Name of a help file that contains further information about objects of this class.
MandatoryProperties

[Visual Basic]
Access: Read/Write
Data Type: VARIANT

[C++]
HRESULT get_MandatoryProperties
(
[out] VARIANT *pvarMandatoryProperties);


HRESULT put_MandatoryProperties
(
[in] VARIANT varMandatoryProperties);

SAFEARRAY of BSTRs that lists the properties that must be set for this class to be written to storage.
OptionalProperties

[Visual Basic]
Access: Read/Write
Data Type: VARIANT

[C++]
HRESULT get_OptionalProperties
(
[out] VARIANT *pvarOptionalProperties);


HRESULT put_OptionalProperties
(
[in] VARIANT varOptionalProperties);

SAFEARRAY of BSTRs that lists the properties that are optional for this schema class.
NamingProperties

[Visual Basic]
Access: Read/Write
Data Type: VARIANT

[C++]
HRESULT get_NamingProperties
(
[out] VARIANT *pvarNamingProperties);


HRESULT put_NamingProperties
(
[in] VARIANT varNamingProperties);

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]
Access: Read/Write
Data Type: BSTR

[C++]
HRESULT get_OID
(
[out] BSTR *pbstrOID);


HRESULT put_OID
(
[in] BSTR bstrOID);

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]
Access: Read/Write
Data Type: VARIANT

[C++]
HRESULT get_PossibleSuperiors
(
[out] VARIANT *pvSuperiors);


HRESULT put_PossibleSuperiors
(
[in] VARIANT vSuperiors);

Array of ADsPath strings that indicate the schema classes that can contain instances of this class.
PrimaryInterface

[Visual Basic]
Access: Read
Data Type: BSTR

[C++]
HRESULT get_PrimaryInterface
(
[out] BSTR *pbstrGUID);

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.

Example Code [Visual Basic]

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

Example Code [C++]

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();

See Also

IADsClass, IADsClass::Qualifiers