MFC is an old tool for developing windowed environments. It is not well supported in Visual Studio 2022.
Visual Studio 2019 Community can be obtained from the following link:
https://archive.org/details/vs_Community
MFC is not installed by default, so be sure to include it in the individual components:

Also, the toolset of the Visual Studio project must match the installed version of MFC: