Directory Services

IADsClass Property Methods

The property methods of the IADsClass interface get or set the following properties. For more information, see Interface Property Methods.

Properties

Property Description
Abstract

[Visual Basic]
Access: Read/Write
DataType: Boolean

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

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]
Access: Read/Write
DataType: 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
DataType: 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
DataType: 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
DataType: Boolean

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

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]
Access: Read/Write
DataType: 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
DataType: 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
DataType: Long

[C++]
HRESULT get_HelpFileContext
([out] long* plHelpContext);
HRESULT put_HelpFileContext
([in] long lHelpContext);

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

[Visual Basic]
Access: Read/Write
DataType: BSTR

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

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

[Visual Basic]
Access: Read/Write
DataType: Variant

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

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]
Access: Read/Write
DataType: Variant

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

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]
Access: Read/Write
DataType: 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.
OptionalProperties

[Visual Basic]
Access: Read/Write
DataType: Variant

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

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]
Access: Read/Write
DataType: 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-only
DataType: 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 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.

Example Code [Visual Basic]

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

Example Code [C++]

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

Requirements

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.

See Also

IADsClass, IADsClass::Qualifiers