Title: About some problems in the configuration process of high-speed Charting Control (ChartCtrl novice orientation) vs2019+win10-2020.12.11

Title: Some problems in the configuration process of high-speed Charting Control (ChartCtrl novice direction) vs2019+win10

Recently, I want to create a program for MFC to draw line charts. I saw a plug-in recommended by everyone on the Internet, which can also be used for business, so I learned ing. This film mainly introduces the configuration method and some problems in the configuration. The detailed configuration method can be seen in the graphic tutorial of the big brother, so I won’t overwhelm the host here, and introduce it briefly.

Precautions

1. Source files including header files and cpp files are all in the source file. If you want to write your own drawing, you don’t need to download demo and instruction files, because they are really not very useful.
2. There is still a problem after some versions of the source are compiled.Inconsistent function declaration. I forgot which function it is. The solution is to change the function parameter type size_t to unsigned in the cpp file, so that it is consistent with the .h file, and there is no problem.
3. At present, most of them use a lower version of vs, and there will be no problems following the tutorial of the big guy. Since I use vs2019, I need to modify it in some places.

The following describes my configuration process
(1) File download, it is recommended to download from GitHub, free of charge. Link https://github.com/HongXG/ChartCtrl
(2) Create a dialog-based MFC application, (it is recommended to give an easy-to-find name, because there are many source files), create a new filter, name it ChartCtrl, right-click, add a new item, and select the file in the source.
(3) Find Custom Control in the toolbox, drag one to the interface, modify the style to 0x52010000, and the class to ChartCtrl.
(4) Add variables to the Custom Control just dragged, variable name m_chartctrl, variable type CChartCtrl. (5) Add #include "ChartCtrl/ChartCtrl.h"
in dlg.h Add the following #include "ChartCtrl/ChartCtrl.h" in dlg.cpp (6) Run, report an error, *



Did you forget to add pch.h
Because the high version vs uses pch instead of stdafx as the compilation header, while the high-speed Charting Control uses the lower version compiled by vs and uses stdafx, so there is an inconsistency.
**Solution:** Open the established ChartCtrl filter, modify each .cpp file and change #include "stdafx" to #include "pch.h"
After the modification, it is still marked red, prompting that pch.h cannot be opened. Don't panic, it's just that the compiler didn't respond, and it won't report an error when it runs.
(7) Run again, there is no error, and there will be no flashback, and the drawing frame is displayed normally, which means the configuration is complete.

I will update the usage skills later, hope it helps. Welcome everyone to exchange and discuss

Guess you like

Origin blog.csdn.net/qq_36076137/article/details/111032383