Communication problem with C++

The Arduino is capable of writing to the serial port. The C++ code is capable of reading from the serial port. Might I suggest that you make use of these two capabilities, to see what the Arduino actually got?

You are still testing for 2 bytes and then reading 5 of them. Fail!