Chapter 13 Quick Reference


To

Do this

Create a property for a C++ class.

Use the __property keyword with get and set methods. For example:

__property void set_Weight(int n) { ...} __property int get_Weight() { ... }

Implement a read-only property.

Implement only the get method.

Implement a write-only property.

Implement only the set method.

Implement an indexed property.

Implement a property whose get and set methods take parameters that are used to determine which value to get or set. For example:

__property void set_Pay(Person*, Amount*); __property Amount* get_Pay(Person*);




Microsoft Visual C++  .NET(c) Step by Step
Microsoft Visual C++ .NET(c) Step by Step
ISBN: 735615675
EAN: N/A
Year: 2003
Pages: 208

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net