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

推荐订阅源

cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Engineering at Meta
Engineering at Meta
U
Unit 42
阮一峰的网络日志
阮一峰的网络日志
The Register - Security
The Register - Security
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Blog — PlanetScale
Blog — PlanetScale
C
Check Point Blog
博客园_首页
云风的 BLOG
云风的 BLOG
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Hugging Face - Blog
Hugging Face - Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
The GitHub Blog
The GitHub Blog
L
LangChain Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 【当耐特】
博客园 - Franky
Cyberwarzone
Cyberwarzone
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
Cisco Blogs
T
Tailwind CSS Blog
Project Zero
Project Zero
博客园 - 叶小钗
S
SegmentFault 最新的问题
K
Kaspersky official blog
B
Blog
T
The Exploit Database - CXSecurity.com
A
About on SuperTechFans
Google DeepMind News
Google DeepMind News
B
Blog RSS Feed
G
Google Developers Blog
Security Latest
Security Latest
T
Tenable Blog
V
Vulnerabilities – Threatpost
C
Cybersecurity and Infrastructure Security Agency CISA
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
H
Help Net Security
T
Threat Research - Cisco Blogs
美团技术团队
AWS News Blog
AWS News Blog
P
Proofpoint News Feed
F
Fortinet All Blogs
NISL@THU
NISL@THU
大猫的无限游戏
大猫的无限游戏
The Last Watchdog
The Last Watchdog
Simon Willison's Weblog
Simon Willison's Weblog
G
GRAHAM CLULEY
D
DataBreaches.Net

博客园 - 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