C # Call ActiveX Controls

Source: Internet
Author: User

Vs Command Prompt

 

1. Use the following two commands to convert the COM control to. netProgramSet
Aximp C:/Windows/system/shdocvw. dll

Tlbimp mshtml. TLB

Aximp will generate two files: axshdocvw. dll and shdocvw. dll.
Tlbimp will generate mshtml. dll, which contains more than 3000 DHTML Dom interfaces, so the conversion may take some time.

2. The above DLL file can be directly called by the. NET application.

Ii. generate an assembly with a strong name

1. Use the SN command to generate three SNK files, which are the key files of the assembly to be generated later

Sn-K axshdoc. SNK
Sn-K shdocvw. SNK
Sn-K mshtml. SNK

2. Use the aximp and tlbimp commands above to generate these three assembly files. Add/Keyfile: Optional
Aximp C:/Windows/system/shdocvw. dll/Keyfile: axshdoc. SNK shdocvw. SNK
Tlbimp mshtml. TLB/Keyfile: mshtml. SNK

In this way, you can generate an assembly with a strong name.

3. add them to the Assembly Cache and call them separately.

Gacutil axshdocvw. dll

Gacutil shdocvw. dll

Gacutil mshtml. dll
Turn on the Global Assembly Cache, and you can see that these three sets are already in the list.

You can also see it in C:/winnt/assembly.

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.