
In ObjectWindows 1.0, the TWindowsObject class was derived from the class
Moving from
Object from the container class library In ObjectWindows 2.0, the.
Object-based
templatized BIDS container class library is used in place of the Object-based
containers to the
container class library The BIDS library provides quicker execution times.
BIDS library
and much greater code flexibility The BIDS templatized container classes.
are described in Chapter 7 of the Borland C++ P ogrammer’ Guide. Thisr s
change affects code that places the TWindow class (the ObjectWindows 2.0
equivalent of TWindowsObject; see page 368) in Object-based containers and
code that calls Object member functions such as IsA, NameOf, and the isXXX
member functions such as isEmpty, isFull, isSortable, and so on.
Code that places the TWindow class in Object-based containers should be
converted to use the BIDS templatized container classes. Otherwise, to put
your own TWindow classes into Object-based containers, you would have
to:
■ Multiply derive your class from Object as well as its ObjectWindows base
class.
■ Implement castability for your class; see the README.TXT file for
information on this procedure.
■ If implementing castability (which is strongly recommended), use the
DYNAMIC_CAST macro to downcast the Objects from the container back
to your TWindow-derived class.
There have been some minor changes to the stream class library There.
Streaming
have also been substantial changes in how streaming is implemented for
ObjectWindows 2.0 classes, although existing code should continue to work
correctly with only minor modifications.
These operators no longer exist:
Removed insertion
opstream &operator <<(opstream &, TStreamable *);
and extraction
ipstream &operator >>(ipstream &, void * &);
operators
If you were calling this << operator you can use the following call instead:,
opstream.WriteObjectPtr((TStreamable *) p);
This >> operator was removed because it had no real functionality.
The Borland C++ 4.0 container class library dramatically simplifies the
Implementing
process of setting up your classes for streaming. The process uses the
streaming
macros DECLARE_STREAMABLE and IMPLEMENT_STREAMABLEX.
Appendix A, Converting ObjectWindows 1.0 code to ObjectWindows 2.0
375