CDN加速镜像 | 设为首页 | 加入收藏夹
当前位置: 首页 资源下载 源码下载 Windows编程 C#编程

文件名称:CsharpCallCppByCLI

  • 所属分类:
  • 标签属性:
  • 上传时间:
    2012-11-16
  • 文件大小:
    65.88kb
  • 已下载:
    0次
  • 提 供 者:
  • 相关连接:
  • 下载说明:
    别用迅雷下载,失败请重下,重下不扣分!

介绍说明--下载内容来自于网络,使用问题请自行百度

一 方法



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

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 搜珍网是交换下载平台,只提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。更多...
  • 本站已设置防盗链,请勿用迅雷、QQ旋风等下载软件下载资源,下载后用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或换浏览器;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.

相关评论

暂无评论内容.

发表评论

*快速评论: 推荐 一般 有密码 和说明不符 不是源码或资料 文件不全 不能解压 纯粹是垃圾
*内  容:
*验 证 码:
搜珍网 www.dssz.com