文件名称:CsharpCallCppByCLI
介绍说明--下载内容来自于网络,使用问题请自行百度
一 方法
C#的project调用C++的DLL,一般也有3中方法:
1)最简单的方法,通过PInvoke,但是只能调用全局function,不能调用Class。
2)通过COM封装调用。
3)通过CLI作为中介,也即本文章所讲的。
二 实例
1)假如我们有的Math的dll,
class CPPDLL_API Math
{
public:
static double Add(double x, double y)
static double Multiply(double x, double y)
}
class CPPDLL_API AdvancedMath
{
public:
static int Factorial(int x)
}
double Math::Add(double x, double y)
{
-failed to translate
C#的project调用C++的DLL,一般也有3中方法:
1)最简单的方法,通过PInvoke,但是只能调用全局function,不能调用Class。
2)通过COM封装调用。
3)通过CLI作为中介,也即本文章所讲的。
二 实例
1)假如我们有的Math的dll,
class CPPDLL_API Math
{
public:
static double Add(double x, double y)
static double Multiply(double x, double y)
}
class CPPDLL_API AdvancedMath
{
public:
static int Factorial(int x)
}
double Math::Add(double x, double y)
{
-failed to translate
(系统自动生成,下载前可以参看下载内容)
下载文件列表
CsharpCallCppByCLI
CsharpCallCppByCLI/CLIWrapper
CsharpCallCppByCLI/CLIWrapper/app.ico
CsharpCallCppByCLI/CLIWrapper/app.rc
CsharpCallCppByCLI/CLIWrapper/AssemblyInfo.cpp
CsharpCallCppByCLI/CLIWrapper/CLIWrapper.cpp
CsharpCallCppByCLI/CLIWrapper/CLIWrapper.h
CsharpCallCppByCLI/CLIWrapper/CLIWrapper.vcproj
CsharpCallCppByCLI/CLIWrapper/CLIWrapper.vcproj.HSLCN.xhzhu.user
CsharpCallCppByCLI/CLIWrapper/CLIWrapper.vcproj.ZHUXIAOH.xhzhu.user
CsharpCallCppByCLI/CLIWrapper/Debug
CsharpCallCppByCLI/CLIWrapper/Debug/BuildLog.htm
CsharpCallCppByCLI/CLIWrapper/MathWrapper.cpp
CsharpCallCppByCLI/CLIWrapper/MathWrapper.h
CsharpCallCppByCLI/CLIWrapper/ReadMe.txt
CsharpCallCppByCLI/CLIWrapper/resource.h
CsharpCallCppByCLI/CLIWrapper/Stdafx.cpp
CsharpCallCppByCLI/CLIWrapper/Stdafx.h
CsharpCallCppByCLI/CppDLL
CsharpCallCppByCLI/CppDLL/CppDLL.cpp
CsharpCallCppByCLI/CppDLL/CppDLL.h
CsharpCallCppByCLI/CppDLL/CppDLL.vcproj
CsharpCallCppByCLI/CppDLL/CppDLL.vcproj.HSLCN.xhzhu.user
CsharpCallCppByCLI/CppDLL/CppDLL.vcproj.ZHUXIAOH.xhzhu.user
CsharpCallCppByCLI/CppDLL/Debug
CsharpCallCppByCLI/CppDLL/Debug/BuildLog.htm
CsharpCallCppByCLI/CppDLL/ReadMe.txt
CsharpCallCppByCLI/CppDLL/stdafx.cpp
CsharpCallCppByCLI/CppDLL/stdafx.h
CsharpCallCppByCLI/CppTest
CsharpCallCppByCLI/CppTest/CppTest.aps
CsharpCallCppByCLI/CppTest/CppTest.cpp
CsharpCallCppByCLI/CppTest/CppTest.h
CsharpCallCppByCLI/CppTest/CppTest.rc
CsharpCallCppByCLI/CppTest/CppTest.vcproj
CsharpCallCppByCLI/CppTest/CppTest.vcproj.HSLCN.xhzhu.user
CsharpCallCppByCLI/CppTest/CppTest.vcproj.ZHUXIAOH.xhzhu.user
CsharpCallCppByCLI/CppTest/CppTestDlg.cpp
CsharpCallCppByCLI/CppTest/CppTestDlg.h
CsharpCallCppByCLI/CppTest/Debug
CsharpCallCppByCLI/CppTest/Debug/BuildLog.htm
CsharpCallCppByCLI/CppTest/ReadMe.txt
CsharpCallCppByCLI/CppTest/res
CsharpCallCppByCLI/CppTest/res/CppTest.ico
CsharpCallCppByCLI/CppTest/res/CppTest.rc2
CsharpCallCppByCLI/CppTest/resource.h
CsharpCallCppByCLI/CppTest/stdafx.cpp
CsharpCallCppByCLI/CppTest/stdafx.h
CsharpCallCppByCLI/CsharpCallCppByCLI.sln
CsharpCallCppByCLI/CsharpTest
CsharpCallCppByCLI/CsharpTest/CsharpTest.csproj
CsharpCallCppByCLI/CsharpTest/Form1.cs
CsharpCallCppByCLI/CsharpTest/Form1.Designer.cs
CsharpCallCppByCLI/CsharpTest/Form1.resx
CsharpCallCppByCLI/CsharpTest/obj
CsharpCallCppByCLI/CsharpTest/obj/Debug
CsharpCallCppByCLI/CsharpTest/obj/Debug/TempPE
CsharpCallCppByCLI/CsharpTest/Program.cs
CsharpCallCppByCLI/CsharpTest/Properties
CsharpCallCppByCLI/CsharpTest/Properties/AssemblyInfo.cs
CsharpCallCppByCLI/CsharpTest/Properties/Resources.Designer.cs
CsharpCallCppByCLI/CsharpTest/Properties/Resources.resx
CsharpCallCppByCLI/CsharpTest/Properties/Settings.Designer.cs
CsharpCallCppByCLI/CsharpTest/Properties/Settings.settings
CsharpCallCppByCLI/CLIWrapper
CsharpCallCppByCLI/CLIWrapper/app.ico
CsharpCallCppByCLI/CLIWrapper/app.rc
CsharpCallCppByCLI/CLIWrapper/AssemblyInfo.cpp
CsharpCallCppByCLI/CLIWrapper/CLIWrapper.cpp
CsharpCallCppByCLI/CLIWrapper/CLIWrapper.h
CsharpCallCppByCLI/CLIWrapper/CLIWrapper.vcproj
CsharpCallCppByCLI/CLIWrapper/CLIWrapper.vcproj.HSLCN.xhzhu.user
CsharpCallCppByCLI/CLIWrapper/CLIWrapper.vcproj.ZHUXIAOH.xhzhu.user
CsharpCallCppByCLI/CLIWrapper/Debug
CsharpCallCppByCLI/CLIWrapper/Debug/BuildLog.htm
CsharpCallCppByCLI/CLIWrapper/MathWrapper.cpp
CsharpCallCppByCLI/CLIWrapper/MathWrapper.h
CsharpCallCppByCLI/CLIWrapper/ReadMe.txt
CsharpCallCppByCLI/CLIWrapper/resource.h
CsharpCallCppByCLI/CLIWrapper/Stdafx.cpp
CsharpCallCppByCLI/CLIWrapper/Stdafx.h
CsharpCallCppByCLI/CppDLL
CsharpCallCppByCLI/CppDLL/CppDLL.cpp
CsharpCallCppByCLI/CppDLL/CppDLL.h
CsharpCallCppByCLI/CppDLL/CppDLL.vcproj
CsharpCallCppByCLI/CppDLL/CppDLL.vcproj.HSLCN.xhzhu.user
CsharpCallCppByCLI/CppDLL/CppDLL.vcproj.ZHUXIAOH.xhzhu.user
CsharpCallCppByCLI/CppDLL/Debug
CsharpCallCppByCLI/CppDLL/Debug/BuildLog.htm
CsharpCallCppByCLI/CppDLL/ReadMe.txt
CsharpCallCppByCLI/CppDLL/stdafx.cpp
CsharpCallCppByCLI/CppDLL/stdafx.h
CsharpCallCppByCLI/CppTest
CsharpCallCppByCLI/CppTest/CppTest.aps
CsharpCallCppByCLI/CppTest/CppTest.cpp
CsharpCallCppByCLI/CppTest/CppTest.h
CsharpCallCppByCLI/CppTest/CppTest.rc
CsharpCallCppByCLI/CppTest/CppTest.vcproj
CsharpCallCppByCLI/CppTest/CppTest.vcproj.HSLCN.xhzhu.user
CsharpCallCppByCLI/CppTest/CppTest.vcproj.ZHUXIAOH.xhzhu.user
CsharpCallCppByCLI/CppTest/CppTestDlg.cpp
CsharpCallCppByCLI/CppTest/CppTestDlg.h
CsharpCallCppByCLI/CppTest/Debug
CsharpCallCppByCLI/CppTest/Debug/BuildLog.htm
CsharpCallCppByCLI/CppTest/ReadMe.txt
CsharpCallCppByCLI/CppTest/res
CsharpCallCppByCLI/CppTest/res/CppTest.ico
CsharpCallCppByCLI/CppTest/res/CppTest.rc2
CsharpCallCppByCLI/CppTest/resource.h
CsharpCallCppByCLI/CppTest/stdafx.cpp
CsharpCallCppByCLI/CppTest/stdafx.h
CsharpCallCppByCLI/CsharpCallCppByCLI.sln
CsharpCallCppByCLI/CsharpTest
CsharpCallCppByCLI/CsharpTest/CsharpTest.csproj
CsharpCallCppByCLI/CsharpTest/Form1.cs
CsharpCallCppByCLI/CsharpTest/Form1.Designer.cs
CsharpCallCppByCLI/CsharpTest/Form1.resx
CsharpCallCppByCLI/CsharpTest/obj
CsharpCallCppByCLI/CsharpTest/obj/Debug
CsharpCallCppByCLI/CsharpTest/obj/Debug/TempPE
CsharpCallCppByCLI/CsharpTest/Program.cs
CsharpCallCppByCLI/CsharpTest/Properties
CsharpCallCppByCLI/CsharpTest/Properties/AssemblyInfo.cs
CsharpCallCppByCLI/CsharpTest/Properties/Resources.Designer.cs
CsharpCallCppByCLI/CsharpTest/Properties/Resources.resx
CsharpCallCppByCLI/CsharpTest/Properties/Settings.Designer.cs
CsharpCallCppByCLI/CsharpTest/Properties/Settings.settings
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.