I tried dynamic_cast<EngineMicrophone*>(pChannel) != NULL and it didn't work.