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[]
-deepyellow(DeepYellow);
2001-2-1
{176}
(#23737@0)
-
in the IRWProp, I=Interface RW=Read/Write Prop=Propertydefine 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[]
-guest:hahaliao;
2001-2-1
{374}
(#23763@0)
-
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.
-deepyellow(DeepYellow);
2001-2-1
{128}
(#23797@0)
-
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.
-guest:hahaliao;
2001-2-2
{91}
(#23950@0)