I wrote an image histogram in vs2010 and started to use the View class. In order to enable the large image, I changed the view to scrollview, but the debug assertion failed is always displayed when I open the image, after searching for the Internet, most of them think that a wild pointer exists.ProgramI read it all over again from start to end and found that all pointer variables were initialized. Where is the error? You can only find it in output. When you click open image, output displays an error: must call setscrollsizes () or setscaletofitsize () before painting scroll view. this reminds me to change the view to scrollview, and scrollview should set an initial value. According to my personal situation, setscrollsize is added to the initialization function of the View class, and the image can be opened normally after running again.
Unicode is a problem. By default, Unicode is used for vs. The old character set is used for programming, leading to garbled characters in the dialog box during running. In this case, it is okay to change the properties of the project, the method is as follows: Project menu -- Project Properties (the last one) -- configuration properties -- General -- project default value -- character set ), change the Unicode character set to not set ).