手动生成TLBIMP-ED dll文件后ActiveX包装? [英] Manually generate ActiveX wrapper after TLBIMP-ed dlls?

查看:180
本文介绍了手动生成TLBIMP-ED dll文件后ActiveX包装?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个的ActiveX组件需要从C#项目访问。

I have several ActiveX components that needed to be accessed from a C# project.

我可以通过Visual Studio的添加引用对话框,这也将自动生成包装类导入。 (即 ABCLib AxABCLib

I can import them via Visual Studio's add reference dialog, which will also automatically generate wrappers class. (i.e. ABCLib and AxABCLib)

我知道,我可以通过运行手动生成主互操作程序集 TLBIMP /初级在每个单独的OCX文件,但我无法找到一个方法来生成的ActiveX包装,除非我通过Visual Studio用户界面做到这一点。

I know that I can generate the primary interop assembly manually by running TLBIMP /primary on each individual OCX file but I could not find a way to generate the ActiveX wrapper unless I do it via Visual Studio user interface.

是否有产生的ActiveX包装在.NET SDK中的命令行版本?

Is there a command-line version that generate the ActiveX wrapper in the .NET SDK?

我要生成的 AxABCLib 版本从PIA我从TLBIMP手动了。 (即设置命名空间,输出的DLL文件名等),这可能吗?

I want to generate the AxABCLib version from the PIA I got from TLBIMP manually. (i.e. setting namespaces, output dll filenames etc.) Is it possible?

推荐答案

呵呵......看着那里TLBIMP属于该文件夹后,发现了它。

Oh... found it after looking at the folder where TLBIMP belongs.

这就是所谓的 AxImp

C:\ Program Files文件\微软的SDK \的Windows \ v6.0A \ BIN \ AxImp.exe

因此​​,基本上,来生成PIA DLL在你自己定制的命名空间:

So basically, to generate a PIA DLL in your own customized namespace:

  1. 注册您的OCX

  1. Register your OCX

REGSVR32 abc.ocx

生成强名称密钥对你的OCX通过运行

Generate a strong name key pair for you ocx by running

SN -k

运行TLBIMP并指定所需的命名空间

Run TLBIMP and specify the desired namespace

TLBIMP abc.ocx /主/keyfile:abc.snk /out:abc.dll /命名空间:myNameSpace对象

运行AXIMP的OCX,并使用 RCW 开关使用自己的manully产生PIA DLL。

Run AXIMP on the ocx and use the rcw switch to use your own manully generated PIA DLL.

aximp abc.ocx /源/rcw:abc.dll

这应该这样做。

然而,有一些问题,古代的TLB导入。我不知道如何解决这个问题呢。

There are however some problems with ancient TLBs being imported. I am not sure how to fix that yet.

这篇关于手动生成TLBIMP-ED dll文件后ActiveX包装?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆