Originale-mail to me for new edition

 

Interface typecasts

 

Interface types follow the same rules as class types in variable and value typecasts. Class-type expressions can be cast to interface types. For example, IMyInterface(SomeObject) provided the class implements the interface.

An interface-type expression can be cast to Variant. If the interface is of type IDispatch or a descendant, the resulting variant has the type code varDispatch. Otherwise, the resulting variant has the type code varUnknown.

A variant whose type code is varEmpty, varUnknown, or varDispatch can be cast to IInterface. A variant whose type code is varEmpty or varDispatch can be cast to IDispatch.

 

Interface querying

 

Topic groups

 

See also

Interface references

Variant types: Overview

 

 

译文

 

接口类型转换

 

在变量和指的类型转换中,接口类型遵循与类类型相同的规则。类类型表达式可以被转换到接口类型。例如,IMyInterface(SomeObject)提供了实现接口的类。

接口类型的表达式可以被转换为Variant类型。如果接口类型是IDispatch或其后裔,那么转换得到的变体其类型代码为varDispatch,否则为varUnknown

类型代码为varEmptyvarUnknownvarDispatch的变体可以被转换为IInterface。类型代码为varEmptyvarDispatch的变体可以被转换为IDispatch

 

接口查询

 

主题组

 

相关主题

接口引用

变体类型:概述