×

Loading...

Topic

This topic has been archived. It cannot be replied.
  • 工作学习 / IT技术讨论 / Hi Experts:Can you pls explain such a macro define for me?Thanks.
    #define IRWProp(name, type, indtype) \
    type Get##name(indtype) const; \
    void Set##name(type, indtype); \
    type __declspec(property(get=Get##name, put=Set##name)) name[]
    • in the IRWProp, I=Interface RW=Read/Write Prop=Property
      define a property's Read/Write interface
      in the IRWProp, I=Interface RW=Read/Write Prop=Property
      in the (name,type,indtype), name=property name ; type property type ; indtype= index type

      for example

      if you give IRWProp(Foo,char,int)
      then you get
      char GetFoo(int) const;
      void SetFoo(char,int);
      type __declspec(property(get=GetFoo,put=SetFoo)) name[]
      • Dear hahaliao,Thanks for your responsing.Is there a typo in the last line of your post that is "char __declspec(property(get=GetFoo,put=SetFoo)) name[]"
        rather than "type __declspec(property(get=GetFoo, put=SetFoo)) name[]"?Can you pls explain this sentence for me? thanks a lot.
        • yes,I made a mistake,you are right.
          you can get the detail about this line code in VC help by index "property".

          Good Luck.