Platform SDK: Active Directory, ADSI, and Directory Services |
The property methods of the IADsSyntax interface get or set the properties described in the following table. For a general discussion of property methods, see Interface Property Methods.
Property | Description | |
---|---|---|
OleAutoDataType
[Visual Basic] [C++] |
Gets and sets a LONG that contains the value of the VT_xxx constant for the Automation data type that represents this syntax.
|
|
Virtual Types VT_BOOL VT_BSTR VT_BSTRT VT_CY VT_DATE VT_EMPTY VT_ERROR VT_I2 VT_I4 VT_R4 VT_R8 VT_UI1 |
Description BOOL BSTR BSTRT CURRENCY Date NULL Invalid short long real double BYTE |
An array of unsigned bytes, VT_UI1|VT_ARRAY could mean that the provider has mapped a syntax that cannot be mapped to an Automation virtual type.
The following Visual Basic® code snippet examines the syntax of the OperatingSystemVersion attribute of a computer on a network through the WinNT provider. The resultant syntax is a string.
Dim obj As IADs Dim cl As IADsClass Dim pr As IADsProperty Dim sy As IADsSyntax Dim sc As IADsContainer Set obj = GetObject("WinNT://myMachine,computer") Set cl = GetObject(obj.Schema) Set sc = GetObject(cl.Parent) Set pr = sc.GetObject("Property","OperatingSystemVersion") Set sy = GetObject(sc.ADsPath & "/" & pr.Syntax) MsgBox "Automation data types: " & sy.OleAutoDataType
The following C++ code snippet examines the syntax of the OperatingSystemVersion attribute of a computer on a network through the WinNT provider. The resultant syntax is a string. For brevity, error checking is omitted.
#include <stdio.h> #include <activeds.h> IADs *pObj; IADsClass *pCls; IADsProperty *pProp; IADsSyntax *pSyn; IADsContainer *pCont; HRESULT hr = ADsGetObject(L"WinNT://myMachine,computer", IID_IADs, (void**)&pObj); VARIANT var; VariantInit(&var); BSTR bstr; pObj->get_Schema(&bstr); pObj->Release(); printf("Object schema: %S\n",bstr); hr = ADsGetObject(bstr, IID_IADsClass,(void**)&pCls); pCls->get_Parent(&bstr); pCls->Release(); printf("Object class's container: %S\n", bstr); hr = ADsGetObject(bstr, IID_IADsContainer, (void**)&pCont); pCont->QueryInterface(IID_IADs,(void**)&pObj); pCont->Release(); pObj->get_ADsPath(&bstr); printf("Container's AdsPath: %S\n",bstr); IDispatch *pDisp; hr = pCont->GetObject(L"Property", L"OperatingSystemVersion", (IDispatch**)&pDisp); pCont->Release(); pDisp->QueryInterface(IID_IADsProperty, (void**)&pProp); pDisp->Release(); BSTR bstr1; pProp->get_Syntax(&bstr1); pProp->Release(); printf("Property Syntax: %S\n",bstr1); wcscat(bstr, L"/"); wcscat(bstr, bstr1); printf("ADsPath of the syntax object %S\n",bstr); hr = ADsGetObject(bstr, IID_IADsSyntax, (void**)&pSyn); long lType; pSyn->get_OleAutoDataType(&lType); printf("Property syntax's OleAutoDataType: %d\n", lType); pSyn->Release(); SysFreeString(bstr); SysFreeString(bstr1);