Downloads
8386.zip

More than one way exists to bind to schema class and schema property objects. For example, the code in Listing A shows another approach. Here's how this code works. First, you bind to the Active Directory (AD) object. Next, you use the IADs::Schema property method to bind to the formal schema class for ADS_OBJECT. Because the AD's Schema container is the parent container of all classes, you can use the IADs::Parent method on any schema class to obtain a pointer to the schema root. You can then bind to the formal schema property definition for any property in the schema by using the IADsContainer::GetObject method to retrieve the schema property object that corresponds to the property's name. For example, if strProp were the string "sAMAccountName", the variable adsProperty would bind to that object in the schema so that you could examine its syntax and so on.