Platform SDK: Active Directory, ADSI, and Directory Services

IADsPropertyValue Property Methods

The property methods of the IADsPropertyValue interface provide access to the properties described in the following table. For more information, see Interface Property Methods.

Properties in Vtable Order

Property Description
ADSType

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

[C++]
HRESULT get_ADSType
([out] LONG *ADSType);

HRESULT put_ADSType
([in] LONG ADSType);

The data type of the value of the property, taken from the ADSTYPEENUM enumeration, of the value property.
DNString

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

[C++]
HRESULT get_DNString
([out] BSTR *bstrDNString);

HRESULT put_DNString

([in] BSTR bstrDNString);

String identifying the distinguished name (path) of a directory service value object.
CaseExactString

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

[C++]
HRESULT get_CaseExactString
([out] BSTR *bstrCaseExactString);

HRESULT put_CaseExactString
([in] BSTR bstrCaseExactString);

String to be interpreted case-sensitively.
CaseIgnoreString

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

[C++]
HRESULT get_CaseIgnoreString
([out] BSTR *bstrCaseIgnoreString);

HRESULT put_CaseIgnoreString
([in] BSTR bstrCaseIgnoreString);

String to be interpreted without regard to case.
PrintableString

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

[C++]
HRESULT get_PrintableString
([out] BSTR *bstrPrintableString);

HRESULT put_PrintableString
([in] BSTR bstrPrintableString);

Displayable or printable string.
NumericString

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

[C++]
HRESULT get_NumericString
([out] BSTR *bstrNumericString);

HRESULT put_NumericString
([in] BSTR bstrNumericString);

Text to be interpreted as numeral.
Boolean

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

[C++]
HRESULT get_Boolean
([out] LONG *lnBoolean);

HRESULT put_Boolean
([in] LONG lnBoolean);

Boolean value.
Integer

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

[C++]
HRESULT get_Integer
([out] LONG *lnInteger);

HRESULT put_Integer
([in] LONG lnInteger);

Integer value.
OctetString

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

[C++]
HRESULT get_OctetString
([out] BSTR *bstrOctetString);

HRESULT put_OctetString
([in] BSTR *bstrOctetString);

Variant array of one-byte characters.
SecurityDescriptor

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

[C++]
HRESULT get_SecurityDescriptor
([out] IDISPATCH **ppSecurityDescriptor);

HRESULT put_SecurityDescriptor
([in] IDISPATCH *pSecurityDescriptor);

Pointer to the IADsSecurityDescriptor interface.
LargeInteger

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

[C++]
HRESULT get_LargeInteger
([out] IDISPATCH **ppLargeInteger);

HRESULT put_LargeInteger
([in] IDISPATCH *pLargeInteger);

Pointer to the IDispatch interface.
UTCTime

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

[C++]
HRESULT get_UTCTime
([out] DATE *daUTCTime);

HRESULT put_UTCTime
([in] DATE daUTCTime);

A date of the VT_DATE type expressed in Coordinated Universal Time (UTC) format.

Example Code [Visual Basic]

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

Example Code [C++]

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

See Also

ADSTYPEENUM, IADsPropertyEntry, IADsPropertyList, IADsPropertyValue2, IADsSecurityDescriptor, Property Cache