共用方式為


Using the IADsExtension Interface

When a late binding support is in place, every function call must go through one IDispatch, ADSI's IDispatch, before rerouting to the appropriate extension.

Consider the following example code:

Set MyObj = GetObject("IIS://W3SVC") 
MyObj.SetPassword("newPassword") 

MyObj.Backup("\\MyServer\Backup") 
MyObj.LastBackup = Date 

MyObj.OtherMethod() 
MyObj.OtherProperty = 314 

Debug.Print MyObj.ServerComment 
Debug.Print(" has been backed up.") 

There aren't any explicit calls to QueryInterface to get to your extensions. The extensions must reroute their IDispatch calls to ADSI's IDispatch. ADSI makes the decision and resolves any conflict if it occurs, then it reroutes back to the appropriate extension through an interface called IADsExtension. Hence, any extension intended to support late binding must implement the IADsExtension interface.