WebBrowser Control--experience with COM components

Source: Internet
Author: User

In the actual development process, encountered such a problem, using the WebBrowser control to open a Web page, the Web page loaded with an OCX control, need to implement two functions, one is to call the Web page JavaScript function, one is the position of the scroll bar in the Mobile Web page. COM component technology is used in all two functions. Also encountered a problem, when the main program is closed, the OCX control in the Web page exception. began to suspect that the OCX control has problems releasing resources, and later debugging found that the WebBrowser control was shut down and the destructor in the OCX control was not executed at all.

The reason was finally found because the idispatch* interface pointer was not freed when two functions were implemented, even if it was passed to another function and released after the function had finished executing.

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.