C#【必备技能篇】VS2019 使用C/C++ 生成DLL 文件,并用 C/C++、C#调用DLL

上传者: sinat_40003796 | 上传时间: 2023-03-01 18:33:54 | 文件大小: 60MB | 文件类型: RAR
在C#开发软件的过程中,要经常调用C/C++生成的dll,本文主要介绍用C/C++生成dll的步骤,以及用C/C++、C#两种语言实现dll的引用实现。本文使用的IDE是VS2019,文章通过具体实例进行讲解,大家可以跟着自己动手进行测试。 原文链接:https://blog.csdn.net/sinat_40003796/article/details/124348814

文件下载

资源详情

[{"title":"( 97 个子文件 60MB ) C#【必备技能篇】VS2019 使用C/C++ 生成DLL 文件,并用 C/C++、C#调用DLL","children":[{"title":"C#【必备技能篇】VS2019 使用CC++ 生成DLL 文件,并用 CC++、C#调用DLL","children":[{"title":"【01】DLL","children":[{"title":"Dll1","children":[{"title":".vs","children":[{"title":"Dll1","children":[{"title":"v16","children":[{"title":"Browse.VC.db <span style='color:#111;'> 1.46MB </span>","children":null,"spread":false},{"title":".suo <span style='color:#111;'> 37.00KB </span>","children":null,"spread":false},{"title":"ipch","children":[{"title":"AutoPCH","children":[{"title":"ecb1a81657611cf9","children":[{"title":"MYDLL.ipch <span style='color:#111;'> 2.00MB </span>","children":null,"spread":false}],"spread":true},{"title":"de514c19300594d3","children":[{"title":"MYDLL.ipch <span style='color:#111;'> 2.00MB </span>","children":null,"spread":false}],"spread":true},{"title":"de5155193005a41e","children":[{"title":"MYDLL.ipch <span style='color:#111;'> 2.31MB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"e0b624b173bf9f43.ipch <span style='color:#111;'> 2.00MB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"Dll1","children":[{"title":"Mydll.c <span style='color:#111;'> 177B </span>","children":null,"spread":false},{"title":"Dll1.vcxproj.user <span style='color:#111;'> 168B </span>","children":null,"spread":false},{"title":"Mydll.h <span style='color:#111;'> 125B </span>","children":null,"spread":false},{"title":"Dll1.vcxproj <span style='color:#111;'> 7.75KB </span>","children":null,"spread":false},{"title":"Dll1.vcxproj.filters <span style='color:#111;'> 1.06KB </span>","children":null,"spread":false},{"title":"Debug","children":[{"title":"Dll1.log <span style='color:#111;'> 157B </span>","children":null,"spread":false},{"title":"Dll1.vcxproj.FileListAbsolute.txt <span style='color:#111;'> 0B </span>","children":null,"spread":false},{"title":"vc142.pdb <span style='color:#111;'> 76.00KB </span>","children":null,"spread":false},{"title":"Dll1.dll.recipe <span style='color:#111;'> 273B </span>","children":null,"spread":false},{"title":"Dll1.ilk <span style='color:#111;'> 329.66KB </span>","children":null,"spread":false},{"title":"Dll1.Build.CppClean.log <span style='color:#111;'> 56B </span>","children":null,"spread":false},{"title":"Mydll.obj <span style='color:#111;'> 7.20KB </span>","children":null,"spread":false},{"title":"vc142.idb <span style='color:#111;'> 27.00KB </span>","children":null,"spread":false},{"title":"Dll1.tlog","children":[{"title":"CL.write.1.tlog <span style='color:#111;'> 292B </span>","children":null,"spread":false},{"title":"CL.read.1.tlog <span style='color:#111;'> 1.98KB </span>","children":null,"spread":false},{"title":"CL.command.1.tlog <span style='color:#111;'> 808B </span>","children":null,"spread":false},{"title":"Dll1.lastbuildstate <span style='color:#111;'> 147B </span>","children":null,"spread":false},{"title":"link.write.1.tlog <span style='color:#111;'> 282B </span>","children":null,"spread":false},{"title":"link.command.1.tlog <span style='color:#111;'> 952B </span>","children":null,"spread":false},{"title":"link.read.1.tlog <span style='color:#111;'> 3.59KB </span>","children":null,"spread":false},{"title":"Dll1.write.1u.tlog <span style='color:#111;'> 202B </span>","children":null,"spread":false}],"spread":false}],"spread":true}],"spread":true},{"title":"Dll1.sln <span style='color:#111;'> 1.40KB </span>","children":null,"spread":false},{"title":"Debug","children":[{"title":"Dll1.pdb <span style='color:#111;'> 716.00KB </span>","children":null,"spread":false},{"title":"Dll1.dll <span style='color:#111;'> 37.50KB </span>","children":null,"spread":false},{"title":"Dll1.lib <span style='color:#111;'> 1.80KB </span>","children":null,"spread":false},{"title":"Dll1.exp <span style='color:#111;'> 794B </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":"【02】C++","children":[{"title":"ConsoleApplication2","children":[{"title":".vs","children":[{"title":"ConsoleApplication2","children":[{"title":"v16","children":[{"title":"Browse.VC.db <span style='color:#111;'> 32.49MB </span>","children":null,"spread":false},{"title":".suo <span style='color:#111;'> 33.00KB </span>","children":null,"spread":false},{"title":"ipch","children":[{"title":"AutoPCH","children":[{"title":"109c174c25849f2c","children":[{"title":"CONSOLEAPPLICATION2.ipch <span style='color:#111;'> 39.00MB </span>","children":null,"spread":false}],"spread":true},{"title":"510ba30568e00","children":[{"title":"CONSOLEAPPLICATION2.ipch <span style='color:#111;'> 39.31MB </span>","children":null,"spread":false}],"spread":true},{"title":"fb6f8f41522b5b1c","children":[{"title":"CONSOLEAPPLICATION2.ipch <span style='color:#111;'> 39.31MB </span>","children":null,"spread":false}],"spread":true},{"title":"202f1b2209a4ab44","children":[{"title":"CONSOLEAPPLICATION2.ipch <span style='color:#111;'> 39.00MB </span>","children":null,"spread":false}],"spread":false},{"title":"c0444249e5399a44","children":[{"title":"CONSOLEAPPLICATION2.ipch <span style='color:#111;'> 33.63MB </span>","children":null,"spread":false}],"spread":false},{"title":"676abaf86a4383f6","children":[{"title":"CONSOLEAPPLICATION2.ipch <span style='color:#111;'> 39.00MB </span>","children":null,"spread":false}],"spread":false},{"title":"f0a98281844c1315","children":[{"title":"CONSOLEAPPLICATION2.ipch <span style='color:#111;'> 42.56MB </span>","children":null,"spread":false}],"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":"v15","children":[{"title":"Browse.VC.db <span style='color:#111;'> 248.00KB </span>","children":null,"spread":false},{"title":".suo <span style='color:#111;'> 29.50KB </span>","children":null,"spread":false},{"title":"ipch","children":[{"title":"AutoPCH","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"ConsoleApplication2.sln <span style='color:#111;'> 1.81KB </span>","children":null,"spread":false},{"title":"ConsoleApplication2","children":[{"title":"ConsoleApplication2.vcxproj.filters <span style='color:#111;'> 979B </span>","children":null,"spread":false},{"title":"ConsoleApplication2.vcxproj <span style='color:#111;'> 7.13KB </span>","children":null,"spread":false},{"title":"x64","children":[{"title":"Debug","children":[{"title":"ConsoleApplication2.obj <span style='color:#111;'> 22.98KB </span>","children":null,"spread":false},{"title":"ConsoleApplication2.exe.recipe <span style='color:#111;'> 307B </span>","children":null,"spread":false},{"title":"ConsoleApplication2.ilk <span style='color:#111;'> 445.38KB </span>","children":null,"spread":false},{"title":"ConsoleApplication2.log <span style='color:#111;'> 127B </span>","children":null,"spread":false},{"title":"vc142.pdb <span style='color:#111;'> 100.00KB </span>","children":null,"spread":false},{"title":"ConsoleA.36f9314a.tlog","children":[{"title":"CL.write.1.tlog <span style='color:#111;'> 612B </span>","children":null,"spread":false},{"title":"CL.read.1.tlog <span style='color:#111;'> 25.41KB </span>","children":null,"spread":false},{"title":"CL.command.1.tlog <span style='color:#111;'> 876B </span>","children":null,"spread":false},{"title":"ConsoleApplication2.lastbuildstate <span style='color:#111;'> 160B </span>","children":null,"spread":false},{"title":"link.write.1.tlog <span style='color:#111;'> 704B </span>","children":null,"spread":false},{"title":"link.command.1.tlog <span style='color:#111;'> 2.83KB </span>","children":null,"spread":false},{"title":"link.read.1.tlog <span style='color:#111;'> 3.89KB </span>","children":null,"spread":false}],"spread":false},{"title":"vc142.idb <span style='color:#111;'> 243.00KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"ConsoleApplication2.vcxproj.user <span style='color:#111;'> 168B </span>","children":null,"spread":false},{"title":"ConsoleApplication2.c <span style='color:#111;'> 828B </span>","children":null,"spread":false},{"title":"Debug","children":[{"title":"ConsoleApplication2.obj <span style='color:#111;'> 22.14KB </span>","children":null,"spread":false},{"title":"ConsoleApplication2.vcxproj.FileListAbsolute.txt <span style='color:#111;'> 0B </span>","children":null,"spread":false},{"title":"ConsoleApplication2.exe.recipe <span style='color:#111;'> 354B </span>","children":null,"spread":false},{"title":"ConsoleApplication2.ilk <span style='color:#111;'> 388.31KB </span>","children":null,"spread":false},{"title":"ConsoleApplication2.log <span style='color:#111;'> 174B </span>","children":null,"spread":false},{"title":"vc142.pdb <span style='color:#111;'> 108.00KB </span>","children":null,"spread":false},{"title":"Dll1.dll <span style='color:#111;'> 37.50KB </span>","children":null,"spread":false},{"title":"ConsoleA.36f9314a.tlog","children":[{"title":"CL.write.1.tlog <span style='color:#111;'> 1.83KB </span>","children":null,"spread":false},{"title":"CL.read.1.tlog <span style='color:#111;'> 50.99KB </span>","children":null,"spread":false},{"title":"CL.command.1.tlog <span style='color:#111;'> 4.75KB </span>","children":null,"spread":false},{"title":"ConsoleApplication2.lastbuildstate <span style='color:#111;'> 288B </span>","children":null,"spread":false},{"title":"link.write.1.tlog <span style='color:#111;'> 1.82KB </span>","children":null,"spread":false},{"title":"link.command.1.tlog <span style='color:#111;'> 7.41KB </span>","children":null,"spread":false},{"title":"link.read.1.tlog <span style='color:#111;'> 7.40KB </span>","children":null,"spread":false}],"spread":false},{"title":"vc142.idb <span style='color:#111;'> 427.00KB </span>","children":null,"spread":false},{"title":"ConsoleApplication2.Build.CppClean.log <span style='color:#111;'> 1.51KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"Debug","children":[{"title":"ConsoleApplication2.exe <span style='color:#111;'> 39.50KB </span>","children":null,"spread":false},{"title":"ConsoleApplication2.pdb <span style='color:#111;'> 1.22MB </span>","children":null,"spread":false},{"title":"MyDll.dll <span style='color:#111;'> 37.50KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":"【03】C#","children":[{"title":"ConsoleApp2","children":[{"title":".vs","children":[{"title":"ConsoleApp2","children":[{"title":"v16","children":[{"title":".suo <span style='color:#111;'> 46.00KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":"ConsoleApp2.sln <span style='color:#111;'> 1.11KB </span>","children":null,"spread":false},{"title":"ConsoleApp2","children":[{"title":"bin","children":[{"title":"Debug","children":[{"title":"ConsoleApp2.exe <span style='color:#111;'> 5.00KB </span>","children":null,"spread":false},{"title":"Dll1.dll <span style='color:#111;'> 37.50KB </span>","children":null,"spread":false},{"title":"ConsoleApp2.exe.config <span style='color:#111;'> 189B </span>","children":null,"spread":false},{"title":"ConsoleApp2.pdb <span style='color:#111;'> 21.50KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"Program.cs <span style='color:#111;'> 661B </span>","children":null,"spread":false},{"title":"obj","children":[{"title":"Debug","children":[{"title":"ConsoleApp2.csproj.FileListAbsolute.txt <span style='color:#111;'> 1.32KB </span>","children":null,"spread":false},{"title":"ConsoleApp2.exe <span style='color:#111;'> 5.00KB </span>","children":null,"spread":false},{"title":"DesignTimeResolveAssemblyReferencesInput.cache <span style='color:#111;'> 6.71KB </span>","children":null,"spread":false},{"title":"TempPE","children":null,"spread":false},{"title":"ConsoleApp2.csproj.AssemblyReference.cache <span style='color:#111;'> 3.99KB </span>","children":null,"spread":false},{"title":"ConsoleApp2.csproj.CoreCompileInputs.cache <span style='color:#111;'> 42B </span>","children":null,"spread":false},{"title":"ConsoleApp2.pdb <span style='color:#111;'> 21.50KB </span>","children":null,"spread":false},{"title":".NETFramework,Version=v4.7.2.AssemblyAttributes.cs <span style='color:#111;'> 214B </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"ConsoleApp2.csproj <span style='color:#111;'> 2.32KB </span>","children":null,"spread":false},{"title":"App.config <span style='color:#111;'> 189B </span>","children":null,"spread":false},{"title":"Properties","children":[{"title":"AssemblyInfo.cs <span style='color:#111;'> 1.28KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明