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

推荐订阅源

罗磊的独立博客
SecWiki News
SecWiki News
酷 壳 – CoolShell
酷 壳 – CoolShell
爱范儿
爱范儿
量子位
M
MIT News - Artificial intelligence
GbyAI
GbyAI
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
TaoSecurity Blog
TaoSecurity Blog
博客园 - 【当耐特】
H
Heimdal Security Blog
腾讯CDC
The Last Watchdog
The Last Watchdog
Security Archives - TechRepublic
Security Archives - TechRepublic
Hacker News: Ask HN
Hacker News: Ask HN
S
Schneier on Security
Microsoft Security Blog
Microsoft Security Blog
WordPress大学
WordPress大学
博客园 - 司徒正美
Recent Commits to openclaw:main
Recent Commits to openclaw:main
C
Cybersecurity and Infrastructure Security Agency CISA
S
SegmentFault 最新的问题
大猫的无限游戏
大猫的无限游戏
Application and Cybersecurity Blog
Application and Cybersecurity Blog
F
Full Disclosure
有赞技术团队
有赞技术团队
T
Tailwind CSS Blog
Engineering at Meta
Engineering at Meta
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
T
Threatpost
月光博客
月光博客
A
Arctic Wolf
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
雷峰网
雷峰网
T
Troy Hunt's Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The Cloudflare Blog
D
DataBreaches.Net
O
OpenAI News
L
LINUX DO - 最新话题
宝玉的分享
宝玉的分享
小众软件
小众软件
V
Vulnerabilities – Threatpost
A
About on SuperTechFans
人人都是产品经理
人人都是产品经理
T
The Exploit Database - CXSecurity.com
Martin Fowler
Martin Fowler
美团技术团队
P
Privacy International News Feed

博客园 - WebQ

工作流软件升级完成 !!!!!!求救:.Net调用迅雷的问题!!!!! 行政审批工作流系统寻求合作 地铁上的遭遇 开始升级我的工作流系统 IE7中如何子窗口只在关闭时刷新opener 英文标点符号翻译大全 One Bug of WatiN? - WebQ How to pass a input parameter in Script task of SSIS Handle alert dialog with WatiN Working overtime The Tongsha ferry (通沙汽渡) over Changjiang river a article about Polymorphism ASP.NET 页面对象模型 Object Serailization What is WSDL? 自定义控件中UserControl(用户控件)和CustomControl(自定义控件)的区别 常见的手机英语 Callback with event and delegate over .net remoting
实现COM组件访问.Net组件的方法
WebQ · 2006-07-09 · via 博客园 - WebQ

当我们项目中同时应用了COM技术及.NET技术时候,其最重要是解决它们之间如何通信、调用的问题,按理论来说,作为非托管代码(UnManaged Code)COM组件与托管代码(Managed Code).Net组件是无法相互调用的,COM组件根本不能在CLR基础构造上运行,受托管的.Net代码也要求其相互作用的代码也必须运行在CLR基础下。既然我们无法做到COM.Net之间的直接调用,那我们就需要创建一个相当于代理的中间介质,它叫做可调用COM包装器(COM callable wrapper (CCW),以下简称为CCW)

如果使用CCW包装器来实现COM.Net之间的调用问题?

1. 开发可在COM组件调用的.Net组件,其中要遵守的两个前提条件。

1.1必须用托管代码创建接口,并确保接口在类中实现。

1.2允许COM组件调用的方法必须定义为Public

创建.Net组件,并通过强名工具进行签名注册。
sn –k sample.snk
将创建一个新的密钥文件

2. 部署可在COM组件调用的.Net组件。

2.1 为你的.net组件创建一个类型库,该.net组件的类型库含有与COM组件相同的元数据,类型库文件扩展名为“.tlb”(工具:tlbexp
   方法:tlbexp sample.dll /out: sample.tlb

2.2 注册.net组件(工具:regasm
   方法:regasm /tlb sample.tlb sample.dll

2.3.net组件安装到全局装配件缓存(GAC)中(工具:gacutil
   方法:gacutil /i sample.dll

posted on 2006-07-09 21:24  WebQ  阅读(319)  评论()    收藏  举报