本人e-mail:[email protected]
改好了,给我发邮件,一定给分。先谢了。

解决方案 »

  1.   

    或者MSN:[email protected]
    谢谢!
      

  2.   

    在.net别想直接使用.lib,你还是连接成.dll之后用importdll调用吧。
      

  3.   

    lib转dll?
    建一个dll项目,包含lib的头文件,setting里的link input加上你要的lib,或者在代码里加
    #progma comment(lib,"xx.lib"), 用def定义你要的输出函数。连接生成dll文件。
      

  4.   

    使用类型库导出工具,生成一个com组件,然后加为.net引用,详细用法及其参数如下:
    Microsoft (R) .NET Framework Type Library to Assembly Converter 1.1.4322.573
    Copyright (C) Microsoft Corporation 1998-2002.  All rights reserved.Syntax: TlbImp TypeLibName [Options]
    Options:
        /out:FileName            File name of assembly to be produced
        /namespace:Namespace     Namespace of the assembly to be produced
        /asmversion:Version      Version number of the assembly to be produced
        /reference:FileName      File name of assembly to use to resolve references
        /publickey:FileName      File containing strong name public key
        /keyfile:FileName        File containing strong name key pair
        /keycontainer:FileName   Key container holding strong name key pair
        /delaysign               Force strong name delay signing
        /unsafe                  Produce interfaces without runtime security checks
        /nologo                  Prevents TlbImp from displaying logo
        /silent                  Suppresses all output except for errors
        /verbose                 Displays extra information
        /primary                 Produce a primary interop assembly
        /sysarray                Import SAFEARRAY as System.Array
        /transform:TransformName Perform the specified transformation
        /strictref               Only use assemblies specified using /reference
        /? or /help              Display this usage messageThe assembly version must be specified as: Major.Minor.Build.Revision.Multiple reference assemblies can be specified by using the /reference option
    multiple times.Supported transforms:
        DispRet                  Apply the [out, retval] parameter transformation
                                 to methods of disp only interfacesA resource ID can optionally be appended to the TypeLibName when importing a
    type library from a module containing multiple type libraries.For example: TlbImp MyModule.dll\1
      

  5.   

    把文件编译成一个 DLL,这样就可以使用了,就像调用 Windows API 一样,使用 System.Runtime.InteropServices 就可以了,MSDN 和网上有很多关于 Interop 的。另外,如果不是 COM 的话,没有必要封装成 COM 再使用。
      

  6.   

    先编译成DLL(不需要是COM组件),然后用P/Invoke调用就可以了。