Platform SDK: Active Directory, ADSI, and Directory Services |
The property methods of the IADsPropertyValue interface provide access to the properties described in the following table. For more information, see Interface Property Methods.
Property | Description |
---|---|
ADSType
[Visual Basic] [C++] |
The data type of the value of the property, taken from the ADSTYPEENUM enumeration, of the value property. |
DNString
[Visual Basic] [C++] |
String identifying the distinguished name (path) of a directory service value object. |
CaseExactString
[Visual Basic] [C++] |
String to be interpreted case-sensitively. |
CaseIgnoreString
[Visual Basic] [C++] |
String to be interpreted without regard to case. |
PrintableString
[Visual Basic] [C++] |
Displayable or printable string. |
NumericString
[Visual Basic] [C++] |
Text to be interpreted as numeral. |
Boolean
[Visual Basic] [C++] |
Boolean value. |
Integer
[Visual Basic] [C++] |
Integer value. |
OctetString
[Visual Basic] [C++] |
Variant array of one-byte characters. |
SecurityDescriptor
[Visual Basic] [C++] |
Pointer to the IADsSecurityDescriptor interface. |
LargeInteger
[Visual Basic] [C++] |
Pointer to the IDispatch interface. |
UTCTime
[Visual Basic] [C++] |
A date of the VT_DATE type expressed in Coordinated Universal Time (UTC) format. |
The property methods are used to render a property value in the specified format, as defined in the previous list. For example, IADsPropertyValue::get_CaseIgnoreString returns a string value that is case insensitive. This is shown in the following Visual Basic code snippet.
Dim propList As IADsPropertyList Dim propEnty As IADsPropertyEntry Dim propVal As IADsPropertyValue ' get the property list Set propList = GetObject("LDAP://dc01/DC=Microsoft,DC=com") propList.GetInfo ' get a property entry Set propEntry = propList.GetPropertyItem("description", ADSTYPE_CASE_IGNORE_STRING) ' print all the values of the property entry For Each v In propEntry.Values Set propVal = v Debug.Print propVal.CaseIgnoreString Next
The following C++ code snippet shows how to use IADsPropertyValue::get_CaseIgnoreString to retrieve the value of the "description" property from a property list.
#include <activeds.h> #include <stdio.h> IADsPropertyList *pList; IADsPropertyEntry *pEntry; IADsPropertyValue *pVal; IADs *pObj; VARIANT var, varProp, varItem; long valType = ADSTYPE_CASE_IGNORE_STRING; BSTR valStr; IEnumVARIANT *pEnum = NULL; LONG lstart, lend; VariantInit(&var); VariantInit(&varItem); // bind to directory object HRESULT hr = ADsGetObject(L"LDAP://dc01/DC=Microsoft,DC=com", IID_IADsPropertyList, (void**)&pList); // initialize the property cache hr = pList->QueryInterface(IID_IADs,(void**)&pObj); pObj->GetInfo(); pObj->Release(); // get a property entry hr = pList->GetPropertyItem(L"description", valType, &var); pList->Release(); hr = V_DISPATCH(&var)->QueryInterface(IID_IADsPropertyEntry, (void**)&pEntry); VariantClear(&var); // get the value array of the property entry hr = pEntry->get_Values(&var); SAFEARRAY *sa = V_ARRAY( &var ); // Get the lower and upper bound and iterate and print the values hr = SafeArrayGetLBound( sa, 1, &lstart ); hr = SafeArrayGetUBound( sa, 1, &lend ); printf(" Property value(s) = "); for ( long idx=lstart; idx < lend+1; idx++ ) { hr = SafeArrayGetElement( sa, &idx, &varItem ); hr = V_DISPATCH(&varItem)->QueryInterface(IID_IADsPropertyValue, (void**)&pVal2); hr = pVal->get_CaseIgnoreString(&valStr); printf(" %S ", valStr); VariantClear(&varItem); } printf("\n"); VariantClear(&var);
ADSTYPEENUM, IADsPropertyEntry, IADsPropertyList, IADsPropertyValue2, IADsSecurityDescriptor, Property Cache