c++ frame implementation