你要先把你的dll加入到引用中com組件中,然后在你的資源管理器中加入引用,再在你的程序中
用using 加入

解决方案 »

  1.   

    点击 菜单栏上的 项目 -> 添加引用 -> Com,然后选择你的Dll
    然后在你的程序开始处使用using 语句
      

  2.   

    先添加对程序集的引用,然后using
      

  3.   

    [DllImport("DLL")]
    方法声明如果DLL中有多个函数要使用,那么上面的代码要重复多次。
      

  4.   

    http://www.vckbase.com/document/viewdoc/?id=414
      

  5.   

    http://chs.gotdotnet.com/QuickStart/howto/default.aspx?url=/quickstart/howto/doc/Interop/Building_Samples_NET2COM.aspx
      

  6.   

    reference-->using-->create instance-->method
      

  7.   

    谢谢楼上各位,但还是不行啊,我用project->add reference->com加入我用vc6写的dll——ForCSharp.dll时,弹出了出错对话框,写着: A reference to "D:\c#\ForCSharp.dll"could not be added.This is not a valid assembly or com component.Only assemblies with extention 'dll' or com component can be referenced
    .Please make sure that the file is accessible and that it is a valid assemblies or com component.小弟实在不懂,ForCSharp.dll不是做成com的,是不是必须要做成com才可以添加引用啊,用vc++6做的非com的dll是不是要在.net 下经过一些转换啊,困惑中,望高手指点
      

  8.   

    这里是一个具体的例子,楼主可以参考一下 :
    http://blog.csdn.net/zhzuo/archive/2004/04/26/22031.aspx