4.8.1 Getting ITypeLib Implementations from Automation Server

Assuming that the automation client already has an IDispatch pointer from the automation server, the following pseudocode shows how to get the ITypeLib implementation.

 INPUT: IDispatch pointer from the Automation Server
  
 CALL IDispatch::GetTypeInfoCount and OBTAIN pcTInfo
 COMMENT see Section 3.1.4.1 for information on pcTInfo
 IF pcTInfo = 0 THEN 
     PRINT Automation Server does not support type information for this object
 ELSE
     CALL IDispatch::GetTypeInfo with correct LocaleID and OBTAIN ITypeInfo pointer
     CALL ITypeInfo::GetContainingTypeLib and OBTAIN ITypeLib pointer
 ENDIF