IADsClass Property Methods
Applies to: desktop apps only
The property methods of the IADsClass interface get or set the following properties. For more information, see Interface Property Methods.
Properties
- Abstract
-
- 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.
- Access type: Read/write
- Scripting data type: BOOLEAN
-
// C++ method syntax HRESULT get_Abstract( [out] BOOLEAN* pbAbstract ); HRESULT put_Abstract( [in] BOOLEAN bAbstract );
- AuxDerivedFrom
-
- Array of ADsPath strings that indicate the super Auxiliary classes this class derives from.
- Access type: Read/write
- Scripting data type: VARIANT
-
// C++ method syntax HRESULT get_AuxDerivedFrom( [out] VARIANT* pvAuxDerivedFrom ); HRESULT put_AuxDerivedFrom( [in] VARIANT vAuxDerivedFrom );
- Auxiliary
-
- 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.
- Access type: Read/write
- Scripting data type: BOOLEAN
-
// C++ method syntax HRESULT get_Auxiliary( [out] BOOLEAN* pbAuxiliary ); HRESULT put_Auxiliary( [in] BOOLEAN bAuxiliary );
- CLSID
-
- Optional provider-specific CLSID identifying the COM object that implements this class.
- Access type: Read/write
- Scripting data type: BSTR
-
// C++ method syntax HRESULT get_CLSID( [out] BSTR* pbstrCLSID ); HRESULT put_CLSID( [in] BSTR bstrCLSID );
- Container
-
- 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.
- Access type: Read/write
- Scripting data type: BOOLEAN
-
// C++ method syntax HRESULT get_Container( [out] BOOLEAN* pbContainer ); HRESULT put_Container( [in] BOOLEAN bContainer );
- Containment
-
- A BSTR array in which each element is the name of an object class that this class can contain.
- Access type: Read/write
- Scripting data type: VARIANT
-
// C++ method syntax HRESULT get_Containment( [out] VARIANT* pvContainment ); HRESULT put_Containment( [in] VARIANT vContainment );
- DerivedFrom
-
- Array of ADsPath strings that indicate which classes this class was derived from.
- Access type: Read/write
- Scripting data type: VARIANT
-
// C++ method syntax HRESULT get_DerivedFrom( [out] VARIANT* pvDerivedFrom ); HRESULT put_DerivedFrom( [in] VARIANT vDerivedFrom );
- HelpFileContext
-
- Context ID inside HelpFileName where specific information for this class can be found.
- Access type: Read/write
- Scripting data type: long
-
// C++ method syntax HRESULT get_HelpFileContext( [out] long* plHelpContext ); HRESULT put_HelpFileContext( [in] long lHelpContext );
- HelpFileName
-
- Name of a help file that contains more information about objects of this class.
- Access type: Read/write
- Scripting data type: BSTR
-
// C++ method syntax HRESULT get_HelpFileName( [out] BSTR* pbstrHelpFileName ); HRESULT put_HelpFileName( [in] BSTR bstrHelpFileName );
- MandatoryProperties
-
- 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.
- Access type: Read/write
- Scripting data type: VARIANT
-
// C++ method syntax HRESULT get_MandatoryProperties( [out] VARIANT* pvarMandatoryProperties ); HRESULT put_MandatoryProperties( [in] VARIANT varMandatoryProperties );
- NamingProperties
-
- 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.
- Access type: Read/write
- Scripting data type: VARIANT
-
// C++ method syntax HRESULT get_NamingProperties( [out] VARIANT* pvarNamingProperties ); HRESULT put_NamingProperties( [in] VARIANT varNamingProperties );
- OID
-
- 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.
- Access type: Read/write
- Scripting data type: BSTR
-
// C++ method syntax HRESULT get_OID( [out] BSTR* pbstrOID ); HRESULT put_OID( [in] BSTR bstrOID );
- OptionalProperties
-
- 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.
- Access type: Read/write
- Scripting data type: VARIANT
-
// C++ method syntax HRESULT get_OptionalProperties( [out] VARIANT* pvarOptionalProperties ); HRESULT put_OptionalProperties( [in] VARIANT varOptionalProperties );
- PossibleSuperiors
-
- Array of ADsPath strings that indicate the schema classes that can contain instances of this class.
- Access type: Read/write
- Scripting data type: VARIANT
-
// C++ method syntax HRESULT get_PossibleSuperiors( [out] VARIANT* pvSuperiors ); HRESULT put_PossibleSuperiors( [in] VARIANT vSuperiors );
- PrimaryInterface
-
- 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.
- Access type: Read-only
- Scripting data type: BSTR
-
// C++ method syntax HRESULT get_PrimaryInterface( [out] BSTR* pbstrGUID );
Examples
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();
Requirements
|
Minimum supported client | Windows 2000 Professional |
|---|---|
|
Minimum supported server | Windows 2000 Server |
|
Header |
|
|
DLL |
|
|
IID |
IID_IADsClass is defined as C8F93DD0-4AE0-11CF-9E73-00AA004A5691 |
See also
Send comments about this topic to Microsoft
Build date: 2/3/2012