如何制作COM DLL? [英] How to make a COM DLL?

查看:26
本文介绍了如何制作COM DLL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我以前从未做过但可能很简单的另一件事......当你知道如何

Just another of those things that I have never done before but which is probably simple ... when you know how

我使用的是 VB Express 2008,需要创建一个非常简单的 DLL.

I am using VB Express 2008 and need to create a very simple DLL.

我已经构建并测试了它,现在我发现它必须是一个 COM DLL.我该怎么做?

I already built and tested it and now I find that it has to be a COM DLL. How do I go about that?

回复@Kman - 我查看了 http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.comvisibleattribute.aspx

in reply to @Kman - I looked at http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.comvisibleattribute.aspx

并将我的代码更改为

Imports System.Runtime.InteropServices

Namespace My_DLL

  <ClassInterface(ClassInterfaceType.AutoDual)> _
  Public Class My_DLL

      <ComVisible(True)> Public Sub Function_A()
      End Sub

      <ComVisible(True)> Public Sub Function_B()
      End Sub
  End Class
End Namespace

但我仍然不使用 DLL Explorer 的函数,而我确实在旧的 DLL 中看到它们......

but I still don't the functions using DLL Explorer, whereas I do see them in the old DLL ...

推荐答案

检查http://www.codeproject.com/KB/COM/nettocom.aspx

也许http://www.exforsys.com/tutorials/vb.net-2005/creating-and-managing-components-in-vb.net-2005-section-1.html

关于它的 MS 页面在这里:http://msdn.microsoft.com/en-us/library/3x7357ez%28vs.71%29.aspx

The MS pages about it are here: http://msdn.microsoft.com/en-us/library/3x7357ez%28vs.71%29.aspx

按照建议进行操作,如果您想了解更多信息,请查看以下书籍.NET 和 Com 完整互操作性指南.一切都在那里以您喜欢的任何细节进行了解释.

Follow the suggestions and if you want to learn more check out the following book .NET and Com the Complete Interoperability Guide. Everything is explained there in whatever detail you like.

这篇关于如何制作COM DLL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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