惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

G
GRAHAM CLULEY
Martin Fowler
Martin Fowler
MongoDB | Blog
MongoDB | Blog
Last Week in AI
Last Week in AI
P
Privacy & Cybersecurity Law Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
博客园 - Franky
Spread Privacy
Spread Privacy
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Project Zero
Project Zero
Engineering at Meta
Engineering at Meta
The Hacker News
The Hacker News
Stack Overflow Blog
Stack Overflow Blog
N
Netflix TechBlog - Medium
A
Arctic Wolf
Cisco Talos Blog
Cisco Talos Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Application and Cybersecurity Blog
Application and Cybersecurity Blog
T
Threat Research - Cisco Blogs
Recorded Future
Recorded Future
Latest news
Latest news
WordPress大学
WordPress大学
有赞技术团队
有赞技术团队
C
CERT Recently Published Vulnerability Notes
美团技术团队
C
CXSECURITY Database RSS Feed - CXSecurity.com
O
OpenAI News
N
News and Events Feed by Topic
MyScale Blog
MyScale Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
B
Blog RSS Feed
酷 壳 – CoolShell
酷 壳 – CoolShell
T
Threatpost
T
The Blog of Author Tim Ferriss
L
LINUX DO - 最新话题
博客园 - 三生石上(FineUI控件)
V
Visual Studio Blog
Hugging Face - Blog
Hugging Face - Blog
博客园 - 【当耐特】
S
Securelist
Microsoft Azure Blog
Microsoft Azure Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
S
Secure Thoughts
罗磊的独立博客
P
Proofpoint News Feed
T
The Exploit Database - CXSecurity.com
Apple Machine Learning Research
Apple Machine Learning Research
Cloudbric
Cloudbric
G
Google Developers Blog

博客园 - verygis

C++/CLI 本地字符串和托管字符串之间的转换 DWF Toolkit on Microsoft Windows Visual studio 2017 c++ wcout 无法输出中文 Javascript 技巧集(1) win10 下 gulp-sass 无法使用的解决 VS2010 下 将 EntityFramework 的版本从 4.0 升级到 5.0 [原]CentOS 6.5 上安装 MySQL 5.6 Filezilla 适用于 Win2003 和 WinXP 的版本 Bower 自定义组件文件夹名称 [原]JQuery mobile CSS 文件组织 [转]Django与遗留系统和数据库集成 [转]mysql在windows下支持表名大小写,lower_case_table_names [转]Installing python 2.7 on centos 6.3. Follow this sequence exactly for centos machine only [转]理解android.intent.category.LAUNCHER 具体作用 [转]如何判断某版本的.NET Framework是否安装 [转]Convert Windows TCHAR argv list to classical char * argv Google V8 源码下载及构建环境 关于网络字节序(network byte order)和主机字节序(host byte order) 宏 UNUSED_PARAM 的作用
[转]在C#中使用IDL文件,IDL是个接口定义文件
verygis · 2012-04-24 · via 博客园 - verygis

在C#中如果我们需要调用API等COM类型的函数,但是很多时候系统里面每月DLL给我直接调用,有Tlb文件还好,VS可以直接引用,但是很多情况下引用是不成功的,要想得到一个C#自动封装好的COM的Interop程序集,我们可以这样做:

1.用MIDL.exe :使用方式为MIDL.exe  IDL文件名。 此工具将生成一个Tlb文件,如果该文件直接可以用VS引用生成Interop程序集则不需要下面的步骤。

2.用TlbImp.exe :使用方式为 TlbImp.exe Tlb文件名。 此工具将生成一个.NET标准的程序集,直接应用就可以了。

3.要想得到生成的Interop程序集的源码,需要自动调整一下,还可以使用reflector,将生成一个CS文件。直接加入项目即可。

原文地址:

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