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

推荐订阅源

cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
C
CERT Recently Published Vulnerability Notes
C
Cybersecurity and Infrastructure Security Agency CISA
P
Proofpoint News Feed
Security Latest
Security Latest
P
Privacy International News Feed
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
AI
AI
Cisco Talos Blog
Cisco Talos Blog
K
Kaspersky official blog
S
Secure Thoughts
PCI Perspectives
PCI Perspectives
Simon Willison's Weblog
Simon Willison's Weblog
D
DataBreaches.Net
GbyAI
GbyAI
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
大猫的无限游戏
大猫的无限游戏
T
Tailwind CSS Blog
The Cloudflare Blog
阮一峰的网络日志
阮一峰的网络日志
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
罗磊的独立博客
V
Visual Studio Blog
aimingoo的专栏
aimingoo的专栏
H
Hackread – Cybersecurity News, Data Breaches, AI and More
IT之家
IT之家
V
V2EX
Last Week in AI
Last Week in AI
有赞技术团队
有赞技术团队
月光博客
月光博客
酷 壳 – CoolShell
酷 壳 – CoolShell
T
Tenable Blog
T
Threat Research - Cisco Blogs
T
Troy Hunt's Blog
V2EX - 技术
V2EX - 技术
S
Security @ Cisco Blogs
Security Archives - TechRepublic
Security Archives - TechRepublic
Project Zero
Project Zero
The GitHub Blog
The GitHub Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
L
Lohrmann on Cybersecurity
F
Full Disclosure
H
Help Net Security
博客园 - Franky
Stack Overflow Blog
Stack Overflow Blog
N
Netflix TechBlog - Medium
Engineering at Meta
Engineering at Meta
A
Arctic Wolf
O
OpenAI News
S
Securelist

博客园 - 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)  评论()    收藏  举报