One of the other things that is missing in the discussion of RTII, etc.
is the fact that dbooo is a pointer and Product is a type. If believe
the syntax you need is
if ( typeid( *dbooo ) == typeid( Product ) ) {
...
} else if ( typeid( *dbooo ) == typeid( Customer ) ) {
Notice the placement of the asterisk.
-E
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of
> Paulo Oliveira
> Sent: Monday, February 14, 2005 2:22 PM
> To: Palm Developer Forum
> Subject: Type Identification.
>
> Hi friends,
>
> I've the following piece of code...
>
> DBObject* dbo = new Product( );
>
> ...where Product class extends DBObject.
>
> How can i, in a later moment, to discover the type of object
> inside dbo variable??? (like a instanceof from Java language!)
>
> My guess was to try the typeid function, like:
>
> ...
> if ( typeid( dbooo ) == typeid( Product ) ) {
> ...
> } else if ( typeid( dbooo ) == typeid( Customer ) ) {
> ...
> }
> ....
>
> But, the code above isn't working! :(
>
> Some help?
>
> Sincerely,
>
> Paulo Oliveira
>
> --
> For information on using the Palm Developer Forums, or to
> unsubscribe, please see http://www.palmos.com/dev/support/forums/
>
--
For information on using the Palm Developer Forums, or to unsubscribe, please
see http://www.palmos.com/dev/support/forums/