博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

VARIANT及相关类

Posted on 2009-01-06 21:23  skyfree  阅读(147)  评论(0编辑  收藏  举报

 

VARIANT (VARIANTARG) is a special type that is a union of different types. VARIANTs can contain most primitive data types, strings, and arrays, but not fixed-length String data type and user-defined data types (也就是说用户自定义的类,以及BSTR等类是不能用VARIANT表示的)

One benefit of using VARIANTs is that Automation servers can perform type coercion(类型强制转换)to interact with typeless languages.  (typeless language在某些方面的确是非常方便呀,感觉ms目前也是越来越重视这个方向了)