c++ interface to handle native events