How Winform references mshtml assembly

Source: Internet
Author: User

Recently, I made a program for querying Unicom numbers. Because it is an automatic query, I Need To screen the js pop-up prompt box on the webpage page to avoid program suspension, So I referenced microsoft mshtml. dll assembly, after the program is released, it is found that it can only be installed on machines with the VS runtime environment, and machines without this environment will receive an error message indicating that the microsoft mshtml assembly is missing and cannot be installed, after finding some information on the Internet and finally solving the problem, I will write down the process and share it with you:

Because Microsoft. mshtmal. dll. This dll is from the mshtml In the system32 folder. tlb (COM-type library file), so we only need to use the TlbImp.exe COM-Type Library export tool that comes with VS2008 to export this tlb file again. Use the following script to export data:

Tlbimp mshtml. tlb/out: mshtml. dll

Finally, an mshtml is obtained. dll Assembly file. mshtmal. replace dll with mshtml. dll, and then the dll can be added to the installation project.

Specific Method: "Start" | "program" | "VS 2008" | "VS tools" | "VS command prompt" input: tlbimp mshtml. tlb/out: C: \ WINDOWS \ system32 \ mshtml. dll after running is complete, find: D: \ Program Files \ Microsoft Visual Studio 9.0 \ VC \ mshtml in the disk area where VS is installed (my security is in D. dll replaces the original program reference set Microsoft. mshtmal. dll.

 

 

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.