Directory Services |
The property methods of the IADsSyntax interface get or set the properties described in the following table. For more information about 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.
Active Directory® supports the following Automation data types:
|
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 code example 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 On Error GoTo Cleanup 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 Cleanup: If (Err.Number<>0) Then MsgBox("An error has occurred. " & Err.Number) End If Set obj = Nothing Set cl = Nothing Set pr = Nothing Set sy = Nothing Set sc = Nothing
The following code example 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> #include <atlbase.h> IADs *pObj = NULL; IADsClass *pCls = NULL; IADsProperty *pProp = NULL; IADsSyntax *pSyn = NULL; IADsContainer *pCont = NULL; HRESULT hr = ADsGetObject(L"WinNT://myMachine,computer", IID_IADs, (void**)&pObj); if(FAILED(hr)){goto Cleanup;} VARIANT var; VariantInit(&var); CComBSTR sbstr; pObj->get_Schema(&sbstr); printf("Object schema: %S\n",sbstr); hr = ADsGetObject(sbstr, IID_IADsClass,(void**)&pCls); if(FAILED(hr)){goto Cleanup;} pCls->get_Parent(&sbstr); printf("Object class's container: %S\n", sbstr); hr = ADsGetObject(sbstr, IID_IADsContainer, (void**)&pCont); if(FAILED(hr)){goto Cleanup;} pCont->QueryInterface(IID_IADs,(void**)&pObj); pObj->get_ADsPath(&sbstr); printf("Container's AdsPath: %S\n",sbstr); IDispatch *pDisp; hr = pCont->GetObject(CComBSTR("Property"), CComBSTR("OperatingSystemVersion"), (IDispatch**)&pDisp); if(FAILED(hr)){goto Cleanup;} hr = pDisp->QueryInterface(IID_IADsProperty, (void**)&pProp); if(FAILED(hr)){goto Cleanup;} hr = pProp->get_Syntax(&sbstr); if(FAILED(hr)){goto Cleanup;} printf("Property Syntax: %S\n",sbstr); printf("ADsPath of the syntax object %S\n",sbstr); hr = ADsGetObject(sbstr, IID_IADsSyntax, (void**)&pSyn); if(FAILED(hr)){goto Cleanup;} long lType; pSyn->get_OleAutoDataType(&lType); printf("Property syntax's OleAutoDataType: %d\n", lType); Cleanup: if(pObj) pObj->Release(); if(pProp) pProp->Release(); if(pCls) pCls->Release(); if(pSyn) pSyn->Release(); if(pCont) pCont->Release();
Client: Included in Windows XP and
Windows 2000 Professional.
Server: Included in Windows Server 2003 and
Windows 2000 Server.
Redistributable: Requires Active Directory Client Extension
on Windows NT 4.0 SP6a and Windows 95/98/Me.
Header: Declared in Iads.h.