I have recently installed Visual Studio 2019 Enterprise Under Windows 10 and configured it for use in Code::Blocks under the generic name 'MSVC'. My projects all refer to a generic 'MSVC' compiler on Windows. This way the project files are unaffected by a compiler upgrade from MSVC2013 to MSVC2019 (or any other combination of compiler versions). The user defined MSVC compiler relies on definitions in C::B global variables to make things easier and avoid repetition.
There is a quick writeup for MSVC2019 configuration at this address
https://github.com/arnholm/cpde_utils/blob/master/doc/toolchain/CodeBlocks_MSVC2019_setup.pdfI still have MSVC2013 installed, and I am able to switch between these compilers using the 'cb_config' tool found in
https://github.com/arnholm/cpde_utils . It works by editing the C::B XML configuration file default.conf. C::B must obviously be closed when this happens so 'cb_config' refuses to do anything if C::B is running.
Switching between MSVC2013/MSVC2019 compilers means to overwrite the definition of the MSVC user defined compiler with settings from either MSVC2013 or MSVC2019 - also user defined compilers. Typically different sets of global variables goes along with each compiler so the corresponding global variable set should be activated at the same time, so this can also be done in 'cb_config'.
In theory you could do these things from within C::B, but changing active global variable set has always been a bit confusing, it does not seem to be activated 100% unless you close and restart C::B. Redefining 'MSVC' to contain definitions for a specific compiler version is impractical if you need to switch back and forth, doing it using the 'cb_config' tool is much easier for my setup.
It would be nice to have these capabilities integrated into the C::B GUI, but using 'cb_config' seems to work fine for now. If you need only MSVC2019, the writeup above should be sufficient.