Mfc bug: MDI + chtmlview + splitter + Windows 7 aero peek = error?

Source: Internet
Author: User
Document directory
  • Reproduction steps
  • Error cause
  • Solution
Reproduction steps
  1. Use vs2010 to create an MFC application project.
  2. In the generate wizard, make the following settings:
  3. Application Type page: Select multiple documents (default)
  4. User Interface page: hook the split window
  5. Generated classes page: Select chtmlview for the base class of the view.
  6. Generate wizard
  7. Compile the debug version to generate the MFC Application
  8. Start the program and use the menu file/New to generate more than two document windows.
  9. In Windows 7, use the aero peek function of the taskbar to preview the document window of the program.
  10. 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/>
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.