• 大小: 18.85MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-07-26
  • 语言: C/C++
  • 标签: C#  C++  DLL  

资源简介

C#调用C++DLL中的函数

资源截图

代码片段和文件信息

//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;
//using System.Threading.Tasks;

//namespace ConsoleApp1
//{
//    class InvokeAdd
//    {
//    }
//}
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.InteropServices;
namespace ConsoleApp1
{
    class InvokeAdd
    {
        [DllImport(“PROJECT4.dll“ CharSet = CharSet.Auto CallingConvention = CallingConvention.Cdecl)]
        public static extern int Add(int x int y);

        [DllImport(“PROJECT4.dll“ CharSet = CharSet.Auto CallingConvention = CallingConvention.Cdecl)]
        public static extern int minus(int x int y);
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-03-19 10:46  ConsoleApp1\
     目录           0  2019-03-19 10:46  ConsoleApp1\.vs\
     目录           0  2019-03-19 10:46  ConsoleApp1\.vs\ConsoleApp1\
     目录           0  2019-03-19 10:46  ConsoleApp1\.vs\ConsoleApp1\v15\
     文件       40448  2019-03-19 11:30  ConsoleApp1\.vs\ConsoleApp1\v15\.suo
     目录           0  2019-03-19 10:46  ConsoleApp1\.vs\ConsoleApp1\v15\Server\
     目录           0  2019-03-19 11:04  ConsoleApp1\.vs\ConsoleApp1\v15\Server\sqlite3\
     文件           0  2019-03-19 10:46  ConsoleApp1\.vs\ConsoleApp1\v15\Server\sqlite3\db.lock
     文件      446464  2019-03-19 11:04  ConsoleApp1\.vs\ConsoleApp1\v15\Server\sqlite3\storage.ide
     文件       32768  2019-03-19 11:04  ConsoleApp1\.vs\ConsoleApp1\v15\Server\sqlite3\storage.ide-shm
     文件       82432  2019-03-19 11:05  ConsoleApp1\.vs\ConsoleApp1\v15\Server\sqlite3\storage.ide-wal
     目录           0  2019-03-19 11:05  ConsoleApp1\ConsoleApp1\
     文件        1131  2019-03-19 10:46  ConsoleApp1\ConsoleApp1.sln
     文件         189  2019-03-19 10:46  ConsoleApp1\ConsoleApp1\App.config
     目录           0  2019-03-19 10:46  ConsoleApp1\ConsoleApp1\bin\
     目录           0  2019-03-19 11:03  ConsoleApp1\ConsoleApp1\bin\Debug\
     文件        5120  2019-03-19 11:05  ConsoleApp1\ConsoleApp1\bin\Debug\ConsoleApp1.exe
     文件         189  2019-03-19 10:46  ConsoleApp1\ConsoleApp1\bin\Debug\ConsoleApp1.exe.config
     文件       15872  2019-03-19 11:05  ConsoleApp1\ConsoleApp1\bin\Debug\ConsoleApp1.pdb
     文件       37376  2019-03-19 11:02  ConsoleApp1\ConsoleApp1\bin\Debug\PROJECT4.dll
     文件        2578  2019-03-19 11:02  ConsoleApp1\ConsoleApp1\bin\Debug\PROJECT4.lib
     文件        2412  2019-03-19 10:56  ConsoleApp1\ConsoleApp1\ConsoleApp1.csproj
     文件         742  2019-03-19 11:04  ConsoleApp1\ConsoleApp1\InvokeAdd.cs
     目录           0  2019-03-19 10:46  ConsoleApp1\ConsoleApp1\obj\
     目录           0  2019-03-19 10:52  ConsoleApp1\ConsoleApp1\obj\Debug\
     文件          42  2019-03-19 10:53  ConsoleApp1\ConsoleApp1\obj\Debug\ConsoleApp1.csproj.CoreCompileInputs.cache
     文件         473  2019-03-19 10:52  ConsoleApp1\ConsoleApp1\obj\Debug\ConsoleApp1.csproj.FileListAbsolute.txt
     文件        8077  2019-03-19 10:46  ConsoleApp1\ConsoleApp1\obj\Debug\ConsoleApp1.csprojAssemblyReference.cache
     文件        5120  2019-03-19 11:05  ConsoleApp1\ConsoleApp1\obj\Debug\ConsoleApp1.exe
     文件       15872  2019-03-19 11:05  ConsoleApp1\ConsoleApp1\obj\Debug\ConsoleApp1.pdb
     文件        6722  2019-03-19 10:53  ConsoleApp1\ConsoleApp1\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
............此处省略54个文件信息

评论

共有 条评论