问题描述
COM/ActiveX 的优点之一是进程外 EXE.您可以有一个 EXE,它以一种其他进程(包括 VBScript 和 JScript)都可以使用的形式公开方法和属性.同时,EXE 可以有自己的功能,与它的类型库公开的功能相关或无关.
One of the nice things about COM/ActiveX was the out-of-process EXE. You could have an EXE which exposed methods and properties in a form usable by both other processes, including VBScript and JScript. At the same time the EXE could have its own functionality, related or unrelated to that exposed by its type library.
.NET 等价物是什么?
What is the .NET equivalent?
我有一个现有的 VB6 项目,它是一个脚本语言解释器(使用 MSScript)和其他脚本语言的各种工具功能的资源.有人建议我尝试将其转换为 .NET.
I have an existing VB6 project which is a scripting language interpreter (using MSScript) and a resource of various tool functions for other scripting languages. It has been suggested that I try converting it to .NET.
这行得通吗,还是我最终会将一件物品分成两份?
Is this going to work, or will I end up splitting the one item into two?
推荐答案
企业服务将允许您这样做.您可以将 COM 组件运行为:
Enterprise services will allow you to do just that. You can run a COM component as:
- 一个 DLLHost 进程
- 一项服务
- 一个 inproc 库(这与您的其他代码在同一进程中)
互联网上有很多关于这些的例子.归根结底是:
There are numerous examples on the internet about these. What it comes down to is:
- 使用接口装饰您需要向 COM 公开的类
- 您要托管的组件需要从 ServicedComponent 派生
- 使用 GuidAttribute 装饰您的界面(使用唯一的 Guid)
- 使用 ComVisible(true) 属性装饰向 COM 公开的接口和类
希望这会有所帮助.
这篇关于.NET 中是否有相当于进程外 COM EXE 的功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)