是这样的:如何用C#调用C++ Lib文件?

解决方案 »

  1.   

    用托管C++(VC++.NET)把那个lib里你想要的东西做成一个DLL,然后C#里添加引用
    或者,用VC++或其他C++的工具把那个LIB里的东西做成一个DLL(win32)
    然后象这样:
    [DllImport("KERNEL32.DLL", EntryPoint="MoveFileW",  SetLastError=true,
    CharSet=CharSet.Unicode, ExactSpelling=true,
    CallingConvention=CallingConvention.StdCall)]
    public static extern bool MoveFile(String src, String dst);System.Runtime.InteropServices.DllImportAttributewww.pinvoke.net