DirectScript Objects

DirectScript consists of a number of objects. Each object supports one or more interfaces. The interfaces and their functions are described later. Each object has a default interface. Getting a pointer to the default interface is straightforward.

If you want to use a domain object's IADsDomain interface, the code looks like this:

Dim Domain As IADsDomain
<Code that actually gets the IADsDomain interface>

Note that a domain object also supports the IADsContainer interface. If you need to use the container functionality then you need to get a pointer to the IADsContainer interface. This is how it is done:

Dim Domain As IADsDomain
Dim DomainContainer As IADsContainer
<Code that actually gets the IADsDomain interface>
Set DomainContainer = Domain 'Bingo! You get an IADsContainer pointer!

When you declare Domain As IADsDomain, you get a pointer to the IADsDomain interface. This is the default interface.

The line Set DomainContainer = Domain actually does a QueryInterface (familiar to Visual C++ developers) on the IADsDomain interface and asks it to return a pointer to the IADsContainer interface. The result is that you get a pointer to a non-default interface for the domain object.

For detailed information, refer to the COM documentation accompanying Visual C++.

The ObjectSecurity object listed below is not part of the ADSI standard. It is a special object included with DirectScript that lets you perform security related operations (granting read/write permissions on directories or files to specific groups or users) on securable objects (directories, files, registry entries, printers).

DirectScript Objects

 

See Also