Export (0) Print
Expand All

IADsClass interface

The IADsClass interface is designed for managing schema class objects that provide class definitions for any ADSI object. Other schema management interfaces include IADsProperty for attribute definitions and IADsSyntax for attribute syntax.

Members

The IADsClass interface inherits from IDispatch and IADs. IADsClass also has these types of members:

Methods

The IADsClass interface has these methods.

MethodDescription
Get

Gets the value for a property by name.

GetEx

Gets the value for a single or multi-valued property by name.

GetInfo

Loads the property values of this object from the underlying directory store.

GetInfoEx

Loads specific property values of this object from the underlying directory store.

Put

Sets the value for a property by name.

PutEx

Sets the value for a single or multi-valued property by name.

Qualifiers

Returns a collection of ADSI objects that describe provider-specific qualifiers for the schema.

SetInfo

Persists the changes on this object to the underlying directory store.

 

Properties

The IADsClass interface has these properties.

PropertyAccess typeDescription

Abstract

Read/write

Gets and sets the flag in order to determine whether or not this schema class is abstract.

AdsPath

Read-only

Gets the object's ADsPath that uniquely identifies this object from all others.

AuxDerivedFrom

Read/write

Gets and sets the immediate super Auxiliary class of this schema class.

Auxiliary

Read/write

Gets and set the flag in order to determine whether or not this schema class is auxiliary.

Class

Read-only

Gets the name of the object's schema class.

CLSID

Read/write

Gets and sets the CLSID identifying application component that implements this schema class.

Container

Read/write

Gets and sets the flag to indicate whether or not this is a container object.

Containment

Read/write

Gets and sets legal objects types that can be contained within this container.

DerivedFrom

Read/write

Gets and sets the immediate super class of this schema class.

GUID

Read-only

Gets the GUID of the object as stored in the underlying directory store.

HelpFileContext

Read/write

Gets and sets the context identifier of an optional help file.

HelpFileName

Read/write

Gets and sets the name of an optional help file.

MandatoryProperties

Read/write

Gets and sets a list of names of the mandatory properties an ADSI object must have.

Name

Read-only

Gets the object's relative name.

NamingProperties

Read/write

Gets and sets a list of naming attributes for the schema object.

OID

Read/write

Gets and sets the directory-specific object identifier.

OptionalProperties

Read/write

Gets and sets a list of names of optional properties an ADSI object may have.

Parent

Read-only

Gets the ADsPath string for the parent of the object.

PossibleSuperiors

Read/write

Gets and sets a list of classes that can contain instances of this class.

PrimaryInterface

Read-only

Gets the identifier of the interface that defines this schema class.

Schema

Read-only

Gets the ADsPath string to the schema class object for this object.

 

Remarks

Schema objects are organized in the schema container of a given directory. To access an object's schema class, use the object's Schema property (namely, call the IADs::get_Schema property method) to obtain the ADsPath string and use that string to bind to its schema class object.

Examples

The following code example shows how to implement the IADsClass interface.


Dim obj As IADs
Dim cls As IADsClass

On Error GoTo Cleanup

Set obj = GetObject("WinNT://myMachine,computer")
Set cls = GetObject(obj.Schema)
 
' Inspecting mandatory and optional properties.
For Each p In cls.MandatoryProperties
    MsgBox "Must-have: " & p
Next
For Each p In cls.OptionalProperties
    MsgBox "May-have: " & p
Next

Cleanup:
    If (Err.Number<>0) Then
        MsgBox("An error has occurred. " & Err.Number)
    End If
    Set obj = Nothing
    Set cls = Nothing

The following code example shows how to implement the IADsClass interface.


HRESULT hr = S_OK;
IADsClass *pCls = NULL;
IADs *pADs;
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);
pCls->get_MandatoryProperties(&var);
hr = printVarArray(var);
 
VariantClear(&var);
pCls->get_OptionalProperties(&var);
hr = printVarArray(var);

Cleanup:
    if(pCls)
        pCls->Release();

    if(pADs)
        pADs->Release();

    SysFreeString(bstrSchema);
    VariantClear(&var);
    CoUninitialize();
    return hr;

The following code example shows how to implement the printVarArray function.


HRESULT printVarArray(VARIANT var)
{
    LONG lstart, lend;
    VARIANT varItem;
    HRESULT hr;
    SAFEARRAY *sa = V_ARRAY( &var );
    hr = SafeArrayGetLBound( sa, 1, &lstart );
    hr = SafeArrayGetUBound( sa, 1, &lend );
    VariantInit(&varItem);
    for ( long idx=lstart; idx <= lend; idx++ ) {
        hr = SafeArrayGetElement( sa, &idx, &varItem );
        printf("   %S \n", V_BSTR(&varItem));
        VariantClear(&varItem);
    }
    printf("\n");
    return S_OK;
}

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2003

Header

Iads.h

DLL

Activeds.dll

IID

IID_IADsClass is defined as C8F93DD0-4AE0-11CF-9E73-00AA004A5691

See also

IDispatch
IADs
IADsContainer
IADsProperty
IADsSyntax

 

 

Show:
© 2015 Microsoft