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.