Check if an object is subtype of a base object

Alain Verleyen  
Amir Yacoby:

Can it somehow be done in MQL5 ?

If I have a pointer of a base class, how can I know if it is of type of the subclass? 

What to do ?
Amir Yacoby  
Alain Verleyen:
What to do ?

class A : CObject
{
};

class B : A
 {
 };

bool IsInstance(CObject *obj)
 {
   return(obj.IsInstanceOf(A));
 }

ALEKSANDR SHUKALOVICH  
Amir Yacoby #:

class A : CObject
{
};

class B : A
 {
 };

bool IsInstance(CObject *obj)
 {
   return(obj.IsInstanceOf(A));
 }

bool IsInstance(CObject *obj)
 {
   return CheckPointer(dynamic_cast<A*>(obj)) != POINTER_INVALID;
 }
Reason: