Get the DOM object in the webpage when OCX is initialized, and ocx initializes the dom object.

Source: Internet
Author: User

Get the DOM object in the webpage when OCX is initialized, and ocx initializes the dom object.

During OCX initialization, SetClientSite is called and the IOleClientSite object is passed in.

1 CComQIPtr <IOleControlSite, & IID_IOleControlSite> spSite (pClientSite); 2 CComDispatchDriver ecDisp; 3 spSite-> GetExtendedControl (& ecDisp );

Based on the IOleClientSite object, we can get the IOleControlSite object, and then get the DOM object of OCX in the webpage through the GetExtendedControl method of the IOleControlSite object.

Note: If you use javascript code createElement and appendChild to dynamically create OCX, you can call GetExtendedControl in SetClientSite of IE11 to obtain the object, however, the object cannot be obtained in IE9 (other versions are not tested ). How to dynamically create OCX allows SetClientSite to call GetExtendedControl to obtain the object. See my other article.

 

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.