id[1]
id[2]
我知道是自动化接口准备的,但id[DISPID_VALUE] id[DISPID_NEWENUM]没有看懂,好象MSDN上有很多
DISPID_XXXX 
那为牛人帮给我说说怎么一会事,小可不胜感激

解决方案 »

  1.   

    这些都是标准的Dispatch ID.在Automation里,每个函数/属性都有一个接口中唯一的DispatchID。你自己定义的Dispatch ID都应该是大于或等于1的。
      

  2.   

    Implementing the _NewEnum Property
    The _NewEnum property identifies an object as supporting iteration through the IEnumVARIANT interface. This property has the following requirements: Must be named _NewEnum and must not be localized. 
    Must return a pointer to the enumerator object's IUnknown interface. 
    Must include DISPID = DISPID_NEWENUM (-4). 
      

  3.   

    [propget, restricted, id(DISPID_NEWENUM)]   // Must be propget.
    HRESULT _NewEnum([out, retval] IUnknown** retval);