implement delegate for event wit c++