As an example, I will discuss tree control since it is more complex. Each structure representing a node item should be declared in such a way that its first data member is an enum type. Enum is declared separatelly and identifies different type of structures which are used in a tree control. After detecting the exact type, I can safelly access all its data members. Using classes for node items With classes it is not possible to rely on an in-memory representation of the class as I did with structures.
Different approach is needed.
First, declare a base class for all classes whose instances will be associated with tree items. Inserting an item into the tree control is the same as previously described. The difference is in getting the pointer to the object in a container. Corp. All Rights Reserved.