Solve the coleexception after chtmlview is used

Source: Internet
Author: User
Tags microsoft c

ProgramWhen the chtmlview class is used to implement browser functions, an exception warning will be output in the window when the window size is adjusted. For example, my warning is as follows:

Warning: constructing coleexception, scode = disp_e_membernotfound ($80020003 ).
The most likely exception at 0x7c80bef7 in htmltest.exe: Microsoft C ++ exception: the coleexception at the memory position 0x0012de68.
Warning: constructing coleexception, scode = disp_e_membernotfound ($80020003 ).
The most likely exception at 0x7c80bef7 in htmltest.exe: Microsoft C ++ exception: the coleexception at the memory position 0x0012de68.

This is because chtmlview processes the wm_size message. After rewriting the wm_size message, the problem can be solved as follows:

Void cmylogshview: onsize (uint ntype, int CX, int CY)
{
Cformview: onsize (ntype, CX, CY); // note that cformview must be used here

// Todo: Add a message processing program hereCode
If (: iswindow (m_wndbrowser.m_hwnd ))
{
Crect rect;
Getclientrect (rect );
: Adjustwindowrectex (rect, getstyle (), false, ws_ex_clientedge );
M_wndbrowser.setwindowpos (null,
Rect. Left,
Rect. Top,
Rect. Width (),
Rect. Height (),
Swp_noactivate | swp_nozorder );
}

}

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.