Use the IDL file in C #. IDL is an interface definition file.

Source: Internet
Author: User

In C #, if we need to call APIs and other com-type functions, but most of the time the system calls the DLL for me every month, it is okay to have a TLB file. VS can be directly referenced, however, in many cases, the reference is unsuccessful. To get a C # automatically encapsulated com InterOPProgramSet, we can do this:

1.use midl.exe: use the format midl.exe IDL file name. This tool generates a TLB file. If the file can be referenced directly by Vs to generate an InterOP assembly, the following steps are not required.

2.use tlbimp.exe: Use tlbimp.exe TLB file name. This tool will generate a. Net standard assembly and apply it directly.

3. To obtain the source code of the InterOP assembly, you must adjust it automatically. You can also use reflector to generate a CS file. Join the project directly.

 

Original article address:

Http://blog.csdn.net/gangzai/article/details/2632792

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.