Mozilla NPAPI (Part 4)

Source: Internet
Author: User

 

Topic of this article: FF plugins encapsulates the IE Activex control.

 

There are two main points:

 

1. Call the COM interface in c ++.

2. Data type conversion.

 

Specific analysis:

 

1. How to call the COM interface in c ++:

 

@ 1 initialize the COM library;

HRESULT hr =: CoInitialize (NULL );

@ 2 create a COM component instance;

Ifiledlg * pdlg = NULL; <br/> // The following is the correction method. <Br/> hR =: cocreateinstance (clsid_filedlg, <br/> null, <br/> clsctx_inproc_server, <br/> iid_ifiledlg, <br/> (void **) & pdlg); <br/>

@ 3 use the COM component interface;

If (succeeded (HR) <br/>{< br/> hR = pdlg-> opendlg (npvariant_to_int32 (ARGs [0]); <br/> If (succeeded (HR) {<br/> //..... <br/>}< br/>}

@ 4 destroy the COM component instance.

Couninitialize ();

 

However, you need to load the library file to be called before calling. You can load the. h and. c files claimed when the COM component is compiled into the calling cpp file.

 

2. Data type conversion.

 

This part encountered some trouble in processing. Fortunately, some pioneers left some code. Refer to the project ff-activex-host.

 

For more information, see.

 

 

 

 

 

 

 

 

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.