Background
Because Chrome has a problem calling ActiveX controls, it is intended to use npapi to encapsulate another layer, while npapi does not support MFC-Based DLL, therefore, ActiveX control cannot be added to the project in the conventional method.
Solution
Add
# Import "C: \ Program Files (x86) \ anysign \ anysignreader \ xssinterface. ocx" no_namespace named_guids
After compilation, the xssinterface. tlh and xssinterface. TLI files are generated, and the OCX method declaration is included in the files.
Initialize OCX before use
Coinitialize (null); // initialize com libraryhresult hR = cocreateinstance (clsid_xssinterface, null, clsctx_all, _ uuidof (_ dxssinterface), (lpvoid *) & m_pocx );
// The clsid_xssinterface, _ dxssinterface, and m_pocx type _ dxssinterface can be found in xssinterface. tlh;
Remember to release the program before exiting
Couninitialize ();
Unsolved Problems
How to respond to events in OCX?
Description
# The path of the OCX specified by import is only used to generate the. tlh and. TLI files. It has nothing to do with the path of the OCX during runtime. It can be used once ocx has been registered on the machine.