[Work Note] No interface program calls ActiveX Control

Source: Internet
Author: User

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.

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.