C#调用C++的库 P/Invoke工具集
p/Invoke可以使用工具辅助自动生成,以减少混淆
1、官方的支持
http://visualstudiogallery.msdn.microsoft.com/site/search?query=p%2Finvoke&f%5B0%5D.Value=p%2Finvoke&f%5B0%5D.Type=SearchText&ac=4
微软的官方扩展上也有很多
开源的工具
http://www.pin5i.com/showtopic-22763.html
看起来微软自己也是深受.NET蹩脚的P/Invoke支持的毒害,因此无奈之余发布了P/Invoke Interop Assistant工具,你可以去下面这个链接来下载这个工具:
http://download.microsoft.com/download/f/2/7/f279e71e-efb0-4155-873d-5554a0608523/CLRInsideOut2008_01.exe
实际上这个工具已经开源了,你可以从这里http://www.codeplex.com/clrinterop/下载到它的源代码
2、经典的讨论区
http://stackoverflow.com/questions/2495632/easiest-way-to-generate-p-invoke-code
- PInvoker: http://www.pinvoker.com
- P/Invoke Interop Assistant: http://www.codeplex.com/clrinterop
- P/Invoke Wizard: http://www.paulyao.com/res/pinvoke/pinvoke.aspx
http://www.paulyao.com/res/pinvoke/pinvoke.aspx
3、社区评论
http://through-the-interface.typepad.com/through_the_interface/2011/04/pinvoke-tools.html
The first tool is the PInvoke Visual Studio Add-in from Red Gate Software (the
UK-based provider of various development tools, including Reflector
Pro). It appears to be a Visual Studio Add-in for VS2003 and 2005 (I
can’t see an update for VS2008 or 2010, which also means I can’t try
it). The tool provides simplified access to the excellent PInvoke.net website, to which I often refer when developing .NET apps. I don’t actually use that many
P/Invoke statements that I feel I need an Add-In, though – which is
perhaps why the add-in doesn’t appear to have been updated for more
recent Visual Studio versions – but it seemed worth mentioning.
The second – in my opinion more interesting – tool is the P/Invoke Interop Assistant(here’s a more in-depth article, the CodePlex hosting site and a Channel 9 interview with one of the authors).
This tool generates P/Invoke signatures for use from C# and VB.NET, as
well as the ability to determine the P/Invoke signatures used in
compiled binaries:
- Generating P/Invoke declarations while searching for commonly-used (presumably Win32) functions, structures, messages, etc.
C#调用C++的库 P/Invoke工具集的更多相关文章
- .netcore在linux下使用P/invoke方式调用linux动态库
http://www.mamicode.com/info-detail-2358309.html .netcore下已经实现了通过p/invoke方式调用linux的动态链接库(*.so)文件 1 ...
- 转:在 C# 中使用 P/Invoke 调用 Mupdf 函数库显示 PDF 文档
在 C# 中使用 P/Invoke 调用 Mupdf 函数库显示 PDF 文档 一直以来,我都想为 PDF 补丁丁添加一个 PDF 渲染引擎.可是,目前并没有可以在 .NET 框架上运行的免费 PDF ...
- C#调用C++动态库(dll)
在实际软件开发过程中,由于公司使用了多种语言开发,在C#中可能需要实现某个功能,而该功能可能用其他语言已经实现了,那么我们可以调用其他语言写好的模块吗?还有就是,由于C#开发好的项目,我们可以利用re ...
- C#总结(四)调用C++动态库
由于公司很多底层的SDK,都是C++开发,上层的应用软件却是C# Winform程序.在实际工作的过程中,就经常碰到了C# 程序调用C++ 动态库的问题.最近一直在和C++ 打交道,C# 怎么调用C+ ...
- c#调用c++动态库的一些理解
调用c++动态库一般我们这样写 [DllImport("UCamer.dll", CallingConvention = CallingConvention.Winapi)] ...
- 【C#】 使用Gsof.Native 动态调用 C动态库
[C#] 使用Gsof.Native 动态调用 C动态库 一.背景 使用C# 开发客户端时候,我们经常会调用一些标准的动态库或是C的类库.虽然C# 提供的PInvoke的方式,但因为使用的场景的多变, ...
- go通过swig封装、调用c++共享库的技术总结
go通过swig封装.调用c++共享库的技术总结 @(知识记录) 1 简介 最近在研究golang,希望能对目前既有的python服务做一些优化,这些服务目前已经占用了6-7台机器.选择golang的 ...
- 使用ctypes在Python中调用C++动态库
使用ctypes在Python中调用C++动态库 入门操作 使用ctypes库可以直接调用C语言编写的动态库,而如果是调用C++编写的动态库,需要使用extern关键字对动态库的函数进行声明: #in ...
- electron调用c#动态库
electron调用c#动态库 新建C#动态库 方法要以异步任务的方式,可以直接包装,也可以写成天然异步 代码如下 public class Class1 { public async Task< ...
随机推荐
- homebrew学习(三)之homebrew命令
安装homebrew: /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/m ...
- 搜索框focus 搜索面板显示 点击别处消失 从浏览器别的页面回来消失
开始是设置了回到页面使display:none(离开页面操作失效),但是发现回到页面,面板显示,dom获取却为null,于是做了个延时的处理 currentPage: function() { var ...
- 位操作符:&位与、|位或、^异或、~求反、<<左移位、>>带符号右移位、>>>无符号右移位
. 操作符 名称 实例(例中使用字节) 描述 & 位与 10101110 & 10010010 得到10000010 两个相应位上比特如果都为1,则执行 与 操作会得到1 | 位或 1 ...
- 交叉工具链和makefile
交叉工具链: arm-linux-gcc:交叉编译器 arm-linux-ld:交叉连接器 arm-linux-readelf:交叉ELF文件工具 arm-linux-objdump:交叉反汇编器 a ...
- java 死锁演示
java 死锁演示 java死锁 模拟死锁生成 死锁是由多个线程竞争同一个资源导致 package com.feshfans; /** * 1. 本代码为展示 java 中死锁的产生 * 2. 死锁的 ...
- C++为什么不可以把一个数组直接赋值给另一个数组
今天好奇一个问题, int a[3] = {1,2,3]; int b[3]; b=a; 编译器报错, 网上找了一圈, 大概明白: C++就是如此设定的, 数组不能直接赋值, 可以使用std::cop ...
- “_MSC_VER”的不匹配项
近些年来vs更新步伐加快,深刻的感受到了技术成长学习的重要性. 另一方面,版本的更换,也带来了许多的问题.今天用2019打开以前2010的工程时就碰到了一个: 检测到“_MSC_VER”的不匹配项: ...
- socket模块其他用法
1.socket模块的其他方法 服务端套接字函数 s.bind() 绑定(主机,端口号)到套接字 s.listen() 开始TCP监听 s.accept() 被动接受TCP客户的连接,(阻塞式)等待连 ...
- 苹果cms怎么上传本地视频资源
今天我们来简单分享下苹果cms怎么上传本地视频,采集资源站的资源我们已经熟知了,但是有的伙伴们想要上传自己制作或是录制的视频应该怎么操作呢?这个问题有多种方法,今天我们先简单的说2种方法. 一,上传到 ...
- python-opencv中的cv2.inRange函数
本次目标是将一副图像从rgb颜色空间转换到hsv颜色空间,颜色去除白色背景部分 具体就调用了cv2的两个函数,一个是rgb转hsv的函数 具体用法 hsv = cv2.cvtColor(rgb_ima ...