It's MFC code.
Remember also that MFC is quite old. It reinvents a lot of stuff that C++ now supports natively, but back in the day, C++ did not support. That is why, sometimes, it can be a lot of code.