jstephe1
asked on
CObArray with different data types
I'm setting up a CObArray to handle multiple data types. For instance I have a CLaser class derived from CObject and a CSerial class derived from CObject. Let's say I place both of these objects into a CObArray object, let's call it m_DeviceArray. Now I want to populate a list box on screen that will tell me what objects are in the array. How could I do this? How could I determine the object type on the fly? I don't know what the object at element 0 is...or the object at element 5 is...but I want to "dump" the object onto the screen.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Yes, cast the pointer (CObject *) to CSerial *.
ASKER
Thanks a lot.
ASKER