updated c++ sample code to use stringrecorder and simplecontext