Document directory
- Reproduction steps
- Error cause
- Solution
Reproduction steps
- Use vs2010 to create an MFC application project.
- In the generate wizard, make the following settings:
- Application Type page: Select multiple documents (default)
- User Interface page: hook the split window
- Generated classes page: Select chtmlview for the base class of the view.
- Generate wizard
- Compile the debug version to generate the MFC Application
- Start the program and use the menu file/New to generate more than two document windows.
- In Windows 7, use the aero peek function of the taskbar to preview the document window of the program.
- Program error
Error cause 1. Void cscrollview: onpreparedc (CDC * PDC, cprintinfo * pinfo) <br/>{< br/> //... <br/> # ifdef _ debug <br/> If (m_nmapmode = mm_none) <br/>{< br/> trace (traceappmsg, 0, "error: must Call setscrollsizes () or setscaletofitsize () "); <br/> trace (traceappmsg, 0,"/tbefore painting scroll view. /n "); <br/> assert (false); <br/> return; <br/>}< br/> # endif // _ debug <br/> // <br/>}2. Void chtmlview: ondraw (CDC */* PDC */) <br/> {<br/> // This class shocould never do its own drawing; <br/> // the browser control shocould handle everything </P> <p> assert (false); <br/>}< br/>Solution 1. Call setscrollsizes in the oninitialupdate Method Void cxxview: oninitialupdate () <br/>{< br/> chtmlview: oninitialupdate (); <br/> setscrollsizes (mm_text, csize (0, 0 )); <br/> navigate2 (_ T ("http://www.msdn.microsoft.com/visualc/"), null, null); <br/>}< br/>2. Override the ondraw method of chtmlview Void cxxview: ondraw (CDC */* PDC */) <br/>{</P> <p >}< br/>