Click to See Complete Forum and Search --> : Class identifier


Flax
April 8th, 1999, 03:26 AM
Heard that classes in VC have a identifier. Would like to know how this is done, and what it is, a string or something like that. (A Macro?)

(needed for serializing classes, and build somekind of check in it... and i know that it is not nice looking..but what the XXX think i programmed to much Java)

(Please not MFC or STL examples... try to avoid them as much as possibel, MFC due to the fact that u loose the perspective, STL cause it becomes hard to read for others althroug i must say that an apply a very strong mechanism is)

Rob Wainwright
April 8th, 1999, 05:59 PM
There are two mechanisms that I know about, namely RTTI and MFC's version of RTTI. The latter is historic. RTTI (Run Time Type Information) is part of the Ansi C++ standard.

There is a project option which will need enabling, i.e. "Enable Run Time Type Information".

Search for RTTI under the VC++ help (I've not got access at the moment). I think the C++ command is type_info.

Hope that helps.